rem: tmp = wmalloc(i+8); *tmp = 0; if (wm_class && wm_instance) { sprintf(tmp, "%s.%s", wm_instance, wm_class); } else { if (wm_instance) strcat(tmp, wm_instance); if (wm_class) strcat(tmp, wm_class); }  key = PLMakeString(tmp); free(tmp); adict = PLGetDictionaryEntry(dict, key);  iconk = PLMakeString("Icon");  if (adict) { val = PLGetDictionaryEntry(adict, iconk); } else {  adict = PLMakeDictionaryFromEntries(NULL, NULL, NULL); PLInsertDictionaryEntry(dict, key, adict); PLRelease(adict); val = NULL; } if (!val) { val = PLMakeString(iconPath); PLInsertDictionaryEntry(adict, iconk, val); PLRelease(val); } PLRelease(key);  if (val) PLSave(dict, YES);
context: wApplicationExtractDirPackIcon(WScreen *scr, char *path, 				char *wm_instance, char *wm_class){    char *iconPath=NULL;    /* Maybe the app is a .app and it has an icon in it, like     * /usr/local/GNUstep/Apps/WPrefs.app/WPrefs.tiff     */    if (strstr(path, ".app")) {	char *tmp;		tmp = wmalloc(strlen(path)+16);		if (scr->flags.supports_tiff) {	    strcpy(tmp, path);	    strcat(tmp, ".tiff");	    if (access(tmp, R_OK)==0)		iconPath = tmp;	}	if (!path) {	    strcpy(tmp, path);	    strcat(tmp, ".xpm");	    if (access(tmp, R_OK)==0)		iconPath = tmp;	}	if (!iconPath)	    free(tmp);    }        if (iconPath) {	proplist_t dict = WDWindowAttributes->dictionary;	proplist_t adict, key, iconk;	proplist_t val;	char *tmp;	int i;		i = 0;	if (wm_instance)	    i += strlen(wm_instance);	if (wm_class)	    i += strlen(wm_class);	tmp = wmalloc(i+8);	*tmp = 0;	if (wm_class && wm_instance) {	    sprintf(tmp, "%s.%s", wm_instance, wm_class);	} else {	    if (wm_instance)		strcat(tmp, wm_instance);	    if (wm_class)		strcat(tmp, wm_class);	}	key = PLMakeString(tmp); 	free(tmp);	adict = PLGetDictionaryEntry(dict, key);		iconk = PLMakeString("Icon");	if (adict) {	    val = PLGetDictionaryEntry(adict, iconk);	} else {	    /* no dictionary for app, so create one */	    adict = PLMakeDictionaryFromEntries(NULL, NULL, NULL);	    PLInsertDictionaryEntry(dict, key, adict);	    PLRelease(adict);	    val = NULL;	}	if (!val) {	    val = PLMakeString(iconPath);	    PLInsertDictionaryEntry(adict, iconk, val);	    PLRelease(val);	}	PLRelease(key);	if (val)	    PLSave(dict, YES);		free(iconPath);    }}