rem: icon->command = wtokenjoin(argv, argc); XFreeStringList(argv);
add: icon->editing = 0;  command = GetCommandForWindow(wwin->client_win); if (command) { icon->command = command;
context: wDockAttachIcon(WDock *dock, WAppIcon *icon, int x, int y){    WWindow *wwin;    char **argv;    int argc;    int index;    wwin = icon->icon->owner;    if (icon->command==NULL) {	icon->editing = 0;	if (XGetCommand(dpy, wwin->client_win, &argv, &argc) && argc>0) {	    icon->command = wtokenjoin(argv, argc);	    XFreeStringList(argv);	} else {	    char *command=NULL;/*	    icon->forced_dock = 1;*/            if (dock->type!=WM_CLIP || !icon->attracted) {		icon->editing = 1;                if (wInputDialog(dock->screen_ptr, _("Dock Icon"),                                 _("Type the command used to launch the application"),				 &command)) {                    if (command && (command[0]==0 ||                                    (command[0]=='-' && command[1]==0))) {                        wfree(command);                        command = NULL;                    }                    icon->command = command;		    icon->editing = 0;                } else {		    icon->editing = 0;		    if (command)			wfree(command);		    /* If the target is the dock, reject the icon. If		     * the target is the clip, make it an attracted icon		     */		    if (dock->type==WM_CLIP) {			icon->attracted = 1;			if (!icon->icon->shadowed) {			    icon->icon->shadowed = 1;			    icon->icon->force_paint = 1;			}		    } else {			return False;		    }                }            }	}    } else {	icon->editing = 0;    }    for (index=1; index<dock->max_icons; index++)        if (dock->icon_array[index] == NULL)            break;    /* if (index == dock->max_icons)         return; */    assert(index < dock->max_icons);    dock->icon_array[index] = icon;    icon->yindex = y;    icon->xindex = x;    icon->omnipresent = 0;    icon->x_pos = dock->x_pos + x*ICON_SIZE;    icon->y_pos = dock->y_pos + y*ICON_SIZE;    dock->icon_count++;    icon->running = 1;    icon->launching = 0;    icon->docked = 1;    icon->dock = dock;    icon->icon->core->descriptor.handle_mousedown = iconMouseDown;    if (dock->type == WM_CLIP) {        icon->icon->core->descriptor.handle_enternotify = clipEnterNotify;        icon->icon->core->descriptor.handle_leavenotify = clipLeaveNotify;    }    icon->icon->core->descriptor.parent_type = WCLASS_DOCK_ICON;    icon->icon->core->descriptor.parent = icon;    MoveInStackListUnder(dock->icon_array[index-1]->icon->core,                         icon->icon->core);    wAppIconMove(icon, icon->x_pos, icon->y_pos);    wAppIconPaint(icon);    if (wPreferences.auto_arrange_icons)        wArrangeIcons(dock->screen_ptr, True);#ifdef OFFIX_DND    if (icon->command && !icon->dnd_command) {	int len = strlen(icon->command)+8;	icon->dnd_command = wmalloc(len);	snprintf(icon->dnd_command, len, "%s %%d", icon->command);    }#endif    if (icon->command && !icon->paste_command) {	int len = strlen(icon->command)+8;	icon->paste_command = wmalloc(len);	snprintf(icon->paste_command, len, "%s %%s", icon->command);    }        return True;}