rem: char *p;
context: storeCommandInScript(char *cmd, char *line){    char *path;    char *p;    FILE *f;    char buffer[128];    p = wusergnusteppath();    path = wmalloc(strlen(p)+64);    sprintf(path, "%s/Library/WindowMaker/autostart", p);    f = fopen(path, "r");    if (!f) {	f = fopen(path, "w");	if (!f) {	    wsyserror(_("could not create %s"), path);	    goto end;	}	fprintf(f, "#!/bin/sh\n");	fputs(line, f);	fputs("\n", f);    } else {	int len = strlen(cmd);	int ok = 0;	char *tmppath;	FILE *fo;	tmppath = wmalloc(strlen(p)+64);	sprintf(tmppath, "%s/Library/WindowMaker/autostart.tmp", p);	fo = fopen(tmppath, "w");	if (!fo) {	    wsyserror(_("could not create temporary file %s"), tmppath);	    goto end;	}	while (!feof(f)) {	    if (!fgets(buffer, 127, f)) {		break;            }            if (buffer[0] == '\n') {                /* don't write empty lines, else the file will grow                 * indefinitely (one '\n' added at end of file on each save).                 */                continue;            }	    if (strncmp(buffer, cmd, len)==0) {		if (!ok) {		    fputs(line, fo);		    fputs("\n", fo);		    ok = 1;		}	    } else {		fputs(buffer, fo);	    }	    	}	if (!ok) {	    fputs(line, fo);	    fputs("\n", fo);	}	fclose(fo);	if (rename(tmppath, path)!=0) {	    wsyserror(_("could not rename file %s to %s\n"), tmppath, path);	}	free(tmppath);    }    sprintf(buffer, "chmod u+x %s", path);    system(buffer);end:    free(path);    if (f)	fclose(f);}