This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
       via  97f68b5865110e617f4c75aee7fb3ba451db0a09 (commit)
       via  883600748ec1c74b055925fd4a51d103f2e86a79 (commit)
       via  9e2d1b3ecf70839c8a56c4b720d2d184910b627c (commit)
       via  4a4775f076751be19303c04d0c2d13bae56f82c6 (commit)
       via  33328d997e0b39ec2afe06808e801bfed5fc7d0a (commit)
       via  6bc550d91bc2fa2b2f8178eb2e7c37d5bfe28e90 (commit)
       via  cbff60297e3522d81417a4ebe28f12cadde9f7b9 (commit)
       via  971f611bad45c0e7a32db18c8a03150c0a6d0cec (commit)
       via  70d8ad515b65a67f727e611567f282de462d3017 (commit)
       via  b5df97db95366327decdd65486fd01f73096b7a9 (commit)
       via  72546aab819344907e821e685eb225a344eb7c18 (commit)
      from  cc30444dda23f40881e29ff3f7bb4414b824513f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/97f68b5865110e617f4c75aee7fb3ba451db0a09

commit 97f68b5865110e617f4c75aee7fb3ba451db0a09
Author: Tobias Stoeckmann <tobias@picolo.pizza.local>
Date:   Sat May 5 19:39:01 2012 +0200

    Fixed typos

diff --git a/WindowMaker/menu b/WindowMaker/menu
index cd876bd..7491f8d 100644
--- a/WindowMaker/menu
+++ b/WindowMaker/menu
@@ -53,7 +53,7 @@
  *     // it in current position
  *     OPEN_MENU file.menu
  *   2. Pipe menu handling.
- *     // opens command and uses it's stdout to construct menu.
+ *     // opens command and uses its stdout to construct menu.
  *     // Command's output must be a valid menu description.
  *     // The space between '|' and command itself is optional.
  *      // Use '||' instead of '|' if you want the menu to always update
@@ -61,12 +61,12 @@
  *     OPEN_MENU | command
  *      OPEN_MENU || command
  *   3. Directory handling.
- *     // Opens one or more directories and construct a menu with all
+ *     // Opens one or more directories and constructs a menu with all
  *     // the subdirectories and executable files in them sorted
  *     // alphabetically.
  *     OPEN_MENU /some/dir [/some/other/dir ...]
  *   4. Directory handling with command.
- *     // Opens one or more directories and construct menu with all
+ *     // Opens one or more directories and constructs menu with all
  *     // subdirectories and readable files in them sorted alphabetically,
  *     // preceding each of them with command.
  *     OPEN_MENU [options] /some/dir [/some/other/dir ...] WITH command 
-options
@@ -78,7 +78,7 @@
  *
  * ** Options for command line in EXEC:
  * %s - substitute with current selection
- * %a(title[,prompt]) - opens a input box with the specified title and the
+ * %a(title[,prompt]) - opens an input box with the specified title and the
  *                     optional prompt and do substitution with what you typed
  * %w - substitute with XID for the current focused window
  * %W - substitute with the number of the current workspace

http://repo.or.cz/w/wmaker-crm.git/commit/883600748ec1c74b055925fd4a51d103f2e86a79

commit 883600748ec1c74b055925fd4a51d103f2e86a79
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Sat May 5 19:32:21 2012 +0200

    Major overhaul of rootmenu's file handling.
    
    This diff fixes a huge amount of issues that could be triggered by using
    the old-fashioned configuration files, i.e menu.  They can be activated
    by using a line like "/path/to/menu".  On most systems, this file will be
    parsed with cpp and the result sent through a pipe to WindowMaker.
    
    Anyway, in the code path, memory leaks and buffer overruns await. I have
    tried to fix these parts, but in the end it is more or less a rewrite,
    whereas I used WINGs whenever possible.
    
    Difference to previous implementation, beside of bugfixes:
    - You are free to use single quotes and double quotes in configuration
    - Linewrapping is allowed for other pipe'd data, too
    - In general, line reading is unified throughout that file
    
    Bugfixes:
    - Avoid buffer overrun on lines which have line wrappings, that will happen
      ALWAYS, because wtrimspace-usage was erroneously.
    - Avoid memory leak, also happened through wtrimspace usage.
    - Avoid buffer overrun in separateline if a line ending happens early.
    - Actually handle ferror() instead of only feof(), that would result in
      endless spinning
    - A line wrapping at the end of a file is an error.

diff --git a/src/rootmenu.c b/src/rootmenu.c
index 94d35d9..aec9ed1 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -882,152 +882,119 @@ static WMenuEntry *addMenuEntry(WMenu * menu, char 
*title, char *shortcut, char
 
 /*******************   Menu Configuration From File   *******************/
 
-static void separateline(char *line, char *title, char *command, char 
*parameter, char *shortcut)
+static void freeline(char *title, char *command, char *parameter, char 
*shortcut)
 {
-       int l, i;
+       wfree(title);
+       wfree(command);
+       wfree(parameter);
+       wfree(shortcut);
+}
 
-       l = strlen(line);
+static void separateline(char *line, char **title, char **command, char 
**parameter, char **shortcut)
+{
+       char *suffix, *next = line;
+
+       *title = NULL;
+       *command = NULL;
+       *parameter = NULL;
+       *shortcut = NULL;
 
-       *title = 0;
-       *command = 0;
-       *parameter = 0;
-       *shortcut = 0;
        /* get the title */
-       while (isspace(*line) && (*line != 0))
-               line++;
-       if (*line == '"') {
-               line++;
-               i = 0;
-               while (line[i] != '"' && (line[i] != 0))
-                       i++;
-               if (line[i] != '"')
-                       return;
-       } else {
-               i = 0;
-               while (!isspace(line[i]) && (line[i] != 0))
-                       i++;
-       }
-       strncpy(title, line, i);
-       title[i++] = 0;
-       line += i;
+       *title = wtokennext(line, &next);
+       if (next == NULL)
+               return;
+       line = next;
 
        /* get the command or shortcut keyword */
-       while (isspace(*line) && (*line != 0))
-               line++;
-       if (*line == 0)
+       *command = wtokennext(line, &next);
+       if (next == NULL)
                return;
-       i = 0;
-       while (!isspace(line[i]) && (line[i] != 0))
-               i++;
-       strncpy(command, line, i);
-       command[i++] = 0;
-       line += i;
-
-       if (strcmp(command, "SHORTCUT") == 0) {
-               /* get the shortcut key */
-               while (isspace(*line) && (*line != 0))
-                       line++;
-               if (*line == '"') {
-                       line++;
-                       i = 0;
-                       while (line[i] != '"' && (line[i] != 0))
-                               i++;
-                       if (line[i] != '"')
-                               return;
-               } else {
-                       i = 0;
-                       while (!isspace(line[i]) && (line[i] != 0))
-                               i++;
-               }
-               strncpy(shortcut, line, i);
-               shortcut[i++] = 0;
-               line += i;
+       line = next;
 
-               *command = 0;
+       if (*command != NULL && strcmp(*command, "SHORTCUT") == 0) {
+               /* get the shortcut */
+               *shortcut = wtokennext(line, &next);
+               if (next == NULL)
+                       return;
+               line = next;
 
                /* get the command */
-               while (isspace(*line) && (*line != 0))
-                       line++;
-               if (*line == 0)
+               *command = wtokennext(line, &next);
+               if (next == NULL)
                        return;
-               i = 0;
-               while (!isspace(line[i]) && (line[i] != 0))
-                       i++;
-               strncpy(command, line, i);
-               command[i++] = 0;
-               line += i;
+               line = next;
        }
 
        /* get the parameters */
-       while (isspace(*line) && (*line != 0))
-               line++;
-       if (*line == 0)
-               return;
+       suffix = wtrimspace(line);
 
-       if (*line == '"') {
-               line++;
-               l = 0;
-               while (line[l] != 0 && line[l] != '"') {
-                       parameter[l] = line[l];
-                       l++;
-               }
-               parameter[l] = 0;
-               return;
+       /* should we keep this weird old behavior? */
+       if (suffix[0] == '"') {
+               *parameter = wtokennext(suffix, &next);
+               wfree(suffix);
+       } else {
+               *parameter = suffix;
        }
-
-       l = strlen(line);
-       while (isspace(line[l]) && (l > 0))
-               l--;
-       strncpy(parameter, line, l);
-       parameter[l] = 0;
 }
 
-static WMenu *parseCascade(WScreen * scr, WMenu * menu, FILE * file, char 
*file_name)
+static char *getLine(FILE * file, const char *file_name)
 {
        char linebuf[MAXLINE];
-       char elinebuf[MAXLINE];
-       char title[MAXLINE];
-       char command[MAXLINE];
-       char shortcut[MAXLINE];
-       char params[MAXLINE];
-       char *line;
+       char *line = NULL, *result = NULL;
+       size_t len;
+       int done;
 
-       while (!feof(file)) {
-               int lsize, ok;
-
-               ok = 0;
-               fgets(linebuf, MAXLINE, file);
+again:
+       done = 0;
+       while (!done && fgets(linebuf, sizeof(linebuf), file) != NULL) {
                line = wtrimspace(linebuf);
-               lsize = strlen(line);
-               do {
-                       if (line[lsize - 1] == '\') {
-                               char *line2;
-                               int lsize2;
-                               fgets(elinebuf, MAXLINE, file);
-                               line2 = wtrimspace(elinebuf);
-                               lsize2 = strlen(line2);
-                               if (lsize2 + lsize > MAXLINE) {
-                                       wwarning(_("%s:maximal line size 
exceeded in menu config: %s"),
-                                                file_name, line);
-                                       ok = 2;
-                               } else {
-                                       line[lsize - 1] = 0;
-                                       lsize += lsize2 - 1;
-                                       strcat(line, line2);
-                               }
-                       } else {
-                               ok = 1;
+               len = strlen(line);
+
+               /* allow line wrapping */
+               if (len > 0 && line[len - 1] == '\') {
+                       line[len - 1] = '0';
+               } else {
+                       done = 1;
+               }
+
+               if (result == NULL) {
+                       result = line;
+               } else {
+                       if (strlen(result) < MAXLINE) {
+                               result = wstrappend(result, line);
                        }
-               } while (!ok && !feof(file));
-               if (ok == 2)
-                       continue;
+                       wfree(line);
+               }
+       }
+       if (!done || ferror(file)) {
+               wfree(result);
+               result = NULL;
+       } else if (result != NULL && (result[0] == 0 || result[0] == '#' ||
+                  (result[0] == '/' && result[1] == '/'))) {
+               wfree(result);
+               result = NULL;
+               goto again;
+       } else if (result != NULL && strlen(result) >= MAXLINE) {
+               wwarning(_("%s:maximal line size exceeded in menu config: %s"),
+                        file_name, line);
+               wfree(result);
+               result = NULL;
+               goto again;
+       }
 
-               if (line[0] == 0 || line[0] == '#' || (line[0] == '/' && 
line[1] == '/'))
-                       continue;
+       return result;
+}
 
-               separateline(line, title, command, params, shortcut);
+static WMenu *parseCascade(WScreen * scr, WMenu * menu, FILE * file, char 
*file_name)
+{
+       char *line;
+       char *command, *params, *shortcut, *title;
 
-               if (!command[0]) {
+       while ((line = getLine(file, file_name)) != NULL) {
+               separateline(line, &title, &command, &params, &shortcut);
+
+               if (command == NULL || !command[0]) {
+                       freeline(title, command, params, shortcut);
                        wwarning(_("%s:missing command in menu config: %s"), 
file_name, line);
                        goto error;
                }
@@ -1046,32 +1013,28 @@ static WMenu *parseCascade(WScreen * scr, WMenu * menu, 
FILE * file, char *file_
                        }
                } else if (strcasecmp(command, "END") == 0) {
                        /* end of menu */
+                       freeline(title, command, params, shortcut);
                        return menu;
-
                } else {
                        /* normal items */
-                       addMenuEntry(menu, M_(title), shortcut[0] ? shortcut : 
NULL, command,
-                                    params[0] ? params : NULL, file_name);
+                       addMenuEntry(menu, M_(title), shortcut, command, 
params, file_name);
                }
+               freeline(title, command, params, shortcut);
        }
 
        wwarning(_("%s:syntax error in menu file:END declaration missing"), 
file_name);
-       return menu;
 
  error:
-       return menu;
+       return NULL;
 }
 
 static WMenu *readMenuFile(WScreen * scr, char *file_name)
 {
        WMenu *menu = NULL;
        FILE *file = NULL;
-       char linebuf[MAXLINE];
-       char title[MAXLINE];
-       char shortcut[MAXLINE];
-       char command[MAXLINE];
-       char params[MAXLINE];
        char *line;
+       char *command, *params, *shortcut, *title;
+       char cmd[MAXLINE];
 #ifdef USECPP
        char *args;
        int cpp = 0;
@@ -1083,9 +1046,9 @@ static WMenu *readMenuFile(WScreen * scr, char *file_name)
                if (!args) {
                        wwarning(_("could not make arguments for menu file 
preprocessor"));
                } else {
-                       snprintf(command, sizeof(command), "%s %s %s", 
CPP_PATH, args, file_name);
+                       snprintf(cmd, sizeof(cmd), "%s %s %s", CPP_PATH, args, 
file_name);
                        wfree(args);
-                       file = popen(command, "r");
+                       file = popen(cmd, "r");
                        if (!file) {
                                werror(_("%s:could not open/preprocess menu 
file"), file_name);
                        } else {
@@ -1103,16 +1066,10 @@ static WMenu *readMenuFile(WScreen * scr, char 
*file_name)
                }
        }
 
-       while (!feof(file)) {
-               if (!fgets(linebuf, MAXLINE, file))
-                       break;
-               line = wtrimspace(linebuf);
-               if (line[0] == 0 || line[0] == '#' || (line[0] == '/' && 
line[1] == '/'))
-                       continue;
-
-               separateline(line, title, command, params, shortcut);
+       while ((line = getLine(file, file_name)) != NULL) {
+               separateline(line, &title, &command, &params, &shortcut);
 
-               if (!command[0]) {
+               if (command == NULL || !command[0]) {
                        wwarning(_("%s:missing command in menu config: %s"), 
file_name, line);
                        break;
                }
@@ -1128,6 +1085,7 @@ static WMenu *readMenuFile(WScreen * scr, char *file_name)
                        break;
                }
        }
+       freeline(title, command, params, shortcut);
 
 #ifdef USECPP
        if (cpp) {
@@ -1150,11 +1108,7 @@ static WMenu *readMenuPipe(WScreen * scr, char 
**file_name)
 {
        WMenu *menu = NULL;
        FILE *file = NULL;
-       char linebuf[MAXLINE];
-       char title[MAXLINE];
-       char command[MAXLINE];
-       char params[MAXLINE];
-       char shortcut[MAXLINE];
+       char *command, *params, *shortcut, *title;
        char *line;
        char *filename;
        char flat_file[MAXLINE];
@@ -1197,16 +1151,10 @@ static WMenu *readMenuPipe(WScreen * scr, char 
**file_name)
                }
        }
 
-       while (!feof(file)) {
-               if (!fgets(linebuf, MAXLINE, file))
-                       break;
-               line = wtrimspace(linebuf);
-               if (line[0] == 0 || line[0] == '#' || (line[0] == '/' && 
line[1] == '/'))
-                       continue;
-
-               separateline(line, title, command, params, shortcut);
+       while ((line = getLine(file, filename)) != NULL) {
+               separateline(line, &title, &command, &params, &shortcut);
 
-               if (!command[0]) {
+               if (command == NULL || !command[0]) {
                        wwarning(_("%s:missing command in menu config: %s"), 
filename, line);
                        break;
                }
@@ -1222,6 +1170,7 @@ static WMenu *readMenuPipe(WScreen * scr, char 
**file_name)
                        break;
                }
        }
+       freeline(title, command, params, shortcut);
 
        pclose(file);
 

http://repo.or.cz/w/wmaker-crm.git/commit/9e2d1b3ecf70839c8a56c4b720d2d184910b627c

commit 9e2d1b3ecf70839c8a56c4b720d2d184910b627c
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Sat May 5 19:42:42 2012 +0200

    Don't fail with assert() in string functions if both strings are NULL.
    
    wstrconcat and wstrappend already support situations in which first OR
    second string are NULL, but not if BOTH are NULL.  Fixed that.

diff --git a/WINGs/string.c b/WINGs/string.c
index d2e8b2a..8da008f 100644
--- a/WINGs/string.c
+++ b/WINGs/string.c
@@ -208,10 +208,12 @@ char *wstrconcat(char *str1, char *str2)
        char *str;
        size_t slen;
 
-       if (!str1)
+       if (!str1 && str2)
                return wstrdup(str2);
-       else if (!str2)
+       else if (str1 && !str2)
                return wstrdup(str1);
+       else if (!str1 && !str2)
+               return NULL;
 
        slen = strlen(str1) + strlen(str2) + 1;
        str = wmalloc(slen);
@@ -228,10 +230,10 @@ char *wstrappend(char *dst, char *src)
 {
        size_t slen;
 
-       if (!dst)
-               return wstrdup(src);
-       else if (!src || *src == 0)
+       if (!src || *src == 0)
                return dst;
+       else if (!dst)
+               return wstrdup(src);
 
        slen = strlen(dst) + strlen(src) + 1;
        dst = wrealloc(dst, slen);

http://repo.or.cz/w/wmaker-crm.git/commit/4a4775f076751be19303c04d0c2d13bae56f82c6

commit 4a4775f076751be19303c04d0c2d13bae56f82c6
Author: Tobias Stoeckmann <tobias@picolo.pizza.local>
Date:   Sat May 5 11:48:00 2012 +0200

    Fixed memory leak in wWorkspaceRename.
    
    The function wtrimspace returns a wmalloced memory region, therefore
    it must be wfreed after usage again.
    
    Please take note that this also happens with every single line
    of menu files, which will get fixed in a separate commit.

diff --git a/src/workspace.c b/src/workspace.c
index 7702d12..7b62798 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -662,6 +662,7 @@ void wWorkspaceRename(WScreen * scr, int workspace, char 
*name)
                strncpy(buf, tmp, MAX_WORKSPACENAME_WIDTH);
        }
        buf[MAX_WORKSPACENAME_WIDTH] = 0;
+       wfree(tmp);
 
        /* update workspace */
        wfree(scr->workspaces[workspace]->name);

http://repo.or.cz/w/wmaker-crm.git/commit/33328d997e0b39ec2afe06808e801bfed5fc7d0a

commit 33328d997e0b39ec2afe06808e801bfed5fc7d0a
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Sat May 5 11:06:15 2012 +0200

    Avoid buffer overrun in parseMenuCommand.
    
    In parseMenuCommand, title[300] might get filled with a string of length
    300.  The string is copied with strcpy, therefore the size would have to be
    301 or -- as I propose -- the fixed value 300 gets replaced with
    "sizeof(title) - 1".  This shows also that the size 300 belongs to title
    and it will already be replaced during compile-time into 299.

diff --git a/src/appmenu.c b/src/appmenu.c
index 6aac338..0d6c7f4 100644
--- a/src/appmenu.c
+++ b/src/appmenu.c
@@ -92,7 +92,7 @@ static WMenu *parseMenuCommand(WScreen * scr, Window win, 
char **slist, int coun
        char title[300];
        char rtext[300];
 
-       if (strlen(slist[*index]) > 300) {
+       if (strlen(slist[*index]) > sizeof(title) - 1) {
                wwarning("appmenu: menu command size exceeded in window %lx", 
win);
                return NULL;
        }

http://repo.or.cz/w/wmaker-crm.git/commit/6bc550d91bc2fa2b2f8178eb2e7c37d5bfe28e90

commit 6bc550d91bc2fa2b2f8178eb2e7c37d5bfe28e90
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Sat May 5 09:57:20 2012 +0200

    Remove curly brackets
    
    ...as they were completely wrapped up by another pair of curly brackets.

diff --git a/src/rootmenu.c b/src/rootmenu.c
index f9b51ab..94d35d9 100644
--- a/src/rootmenu.c
+++ b/src/rootmenu.c
@@ -213,29 +213,25 @@ static void shutdownCommand(WMenu * menu, WMenuEntry * 
entry)
        if ((long)entry->clientdata == M_QUICK)
                result = R_CLOSE;
        else {
-               {
-                       int r, oldSaveSessionFlag;
-
-                       oldSaveSessionFlag = wPreferences.save_session_on_exit;
-
-                       r = wExitDialog(menu->frame->screen_ptr,
-                                       _("Kill X session"),
-                                       _("Kill Window System session?n"
-                                         "(all applications will be closed)"), 
_("Kill"), _("Cancel"), NULL);
-                       if (r == WAPRDefault) {
-                               result = R_KILL;
-                       } else if (r == WAPRAlternate) {
-                               /* Don't modify the "save session on exit" flag 
if the
-                                * user canceled the operation. */
-                               wPreferences.save_session_on_exit = 
oldSaveSessionFlag;
-                       }
+               int r, oldSaveSessionFlag;
+
+               oldSaveSessionFlag = wPreferences.save_session_on_exit;
+
+               r = wExitDialog(menu->frame->screen_ptr,
+                               _("Kill X session"),
+                               _("Kill Window System session?n"
+                                 "(all applications will be closed)"), 
_("Kill"), _("Cancel"), NULL);
+               if (r == WAPRDefault) {
+                       result = R_KILL;
+               } else if (r == WAPRAlternate) {
+                       /* Don't modify the "save session on exit" flag if the
+                        * user canceled the operation. */
+                       wPreferences.save_session_on_exit = oldSaveSessionFlag;
                }
        }
 
        if (result != R_CANCEL) {
-               {
-                       Shutdown(WSKillMode);
-               }
+               Shutdown(WSKillMode);
        }
 #undef R_CLOSE
 #undef R_CANCEL

http://repo.or.cz/w/wmaker-crm.git/commit/cbff60297e3522d81417a4ebe28f12cadde9f7b9

commit cbff60297e3522d81417a4ebe28f12cadde9f7b9
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Sat May 5 09:55:24 2012 +0200

    Easier code path in appIconMouseDown

diff --git a/src/appicon.c b/src/appicon.c
index 198fe53..cd0e4ad 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -547,10 +547,9 @@ void appIconMouseDown(WObjDescriptor * desc, XEvent * 
event)
        if (event->xbutton.button == Button2) {
                WApplication *wapp = 
wApplicationOf(aicon->icon->owner->main_window);
 
-               if (!wapp)
-                       return;
+               if (wapp)
+                       relaunchApplication(wapp);
 
-               relaunchApplication(wapp);
                return;
        }
 

http://repo.or.cz/w/wmaker-crm.git/commit/971f611bad45c0e7a32db18c8a03150c0a6d0cec

commit 971f611bad45c0e7a32db18c8a03150c0a6d0cec
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Sat May 5 09:53:38 2012 +0200

    wstrdup cannot fail, therefore no need to check for NULL.

diff --git a/src/dock.c b/src/dock.c
index 3b5c121..155e1a8 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -171,9 +171,8 @@ static void renameCallback(WMenu *menu, WMenuEntry *entry)
        if (wInputDialog(dock->screen_ptr, _("Rename Workspace"), buffer, 
&name)) {
                wWorkspaceRename(dock->screen_ptr, wspace, name);
        }
-       if (name) {
-               wfree(name);
-       }
+
+       wfree(name);
 }
 
 static void toggleLoweredCallback(WMenu *menu, WMenuEntry *entry)

http://repo.or.cz/w/wmaker-crm.git/commit/70d8ad515b65a67f727e611567f282de462d3017

commit 70d8ad515b65a67f727e611567f282de462d3017
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Sat May 5 09:44:42 2012 +0200

    Easier error path in wDockTrackWindowLaunch.
    
    There is no need to allocate command if the very next line might
    fail independently from comand, freeing that memory again in error path.

diff --git a/src/dock.c b/src/dock.c
index 9d12814..3b5c121 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -2863,15 +2863,11 @@ void wDockTrackWindowLaunch(WDock *dock, Window window)
        Bool found = False;
        char *command = NULL;
 
-       command = GetCommandForWindow(window);
-
        if (!PropGetWMClass(window, &wm_class, &wm_instance) || (!wm_class && 
!wm_instance)) {
-
-               if (command)
-                       wfree(command);
                return;
        }
 
+       command = GetCommandForWindow(window);
  retry:
        for (i = 0; i < dock->max_icons; i++) {
                icon = dock->icon_array[i];

http://repo.or.cz/w/wmaker-crm.git/commit/b5df97db95366327decdd65486fd01f73096b7a9

commit b5df97db95366327decdd65486fd01f73096b7a9
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Sat May 5 09:29:29 2012 +0200

    Removed unused "buffer" variables.

diff --git a/src/usermenu.c b/src/usermenu.c
index e0acc57..b81e3c8 100644
--- a/src/usermenu.c
+++ b/src/usermenu.c
@@ -133,7 +133,7 @@ static WUserMenuData *convertShortcuts(WScreen * scr, 
WMPropList * shortcut)
 {
        WUserMenuData *data;
        KeySym ksym;
-       char *k, *buffer, buf[MAX_SHORTCUT_LENGTH], *b;
+       char *k, buf[MAX_SHORTCUT_LENGTH], *b;
        int keycount, i, j, mod;
 
        if (WMIsPLString(shortcut)) {
@@ -334,7 +334,6 @@ static WMenu *readUserMenuFile(WScreen * scr, char 
*file_name)
 WMenu *wUserMenuGet(WScreen * scr, WWindow * wwin)
 {
        WMenu *menu = NULL;
-       char buffer[100];
        char *path = NULL;
        char *tmp;
        if (wwin->wm_instance && wwin->wm_class) {

http://repo.or.cz/w/wmaker-crm.git/commit/72546aab819344907e821e685eb225a344eb7c18

commit 72546aab819344907e821e685eb225a344eb7c18
Author: Tobias Stoeckmann <tob...@openbsd.org>
Date:   Sat May 5 09:12:47 2012 +0200

    Get rid of NEW definition.
    
    The NEW definition merely calls wmalloc now, therefore it is not needed
    anymore.  Pointed out and requested by Carlos R. Mafra.

diff --git a/WPrefs.app/Menu.c b/WPrefs.app/Menu.c
index e9eaa9b..4a8cc94 100644
--- a/WPrefs.app/Menu.c
+++ b/WPrefs.app/Menu.c
@@ -155,8 +155,6 @@ static char *commandNames[] = {
        "LEGAL_PANEL"
 };
 
-#define NEW(type) wmalloc(sizeof(type))
-
 #define ICON_FILE      "menus"
 
 static void showData(_Panel * panel);
@@ -317,7 +315,7 @@ static ItemData *putNewItem(_Panel * panel, WEditMenu * 
menu, int type, char *ti
 
        item = WAddMenuItemWithTitle(menu, title);
 
-       data = NEW(ItemData);
+       data = wmalloc(sizeof(ItemData));
        data->type = type;
        WSetEditMenuItemData(item, data, (WMCallback *) freeItemData);
        WSetEditMenuItemImage(item, panel->markerPix[type]);
@@ -856,7 +854,7 @@ static void freeItemData(ItemData * data)
 
 static ItemData *parseCommand(WMPropList * item)
 {
-       ItemData *data = NEW(ItemData);
+       ItemData *data = wmalloc(sizeof(ItemData));
        WMPropList *p;
        char *command = NULL;
        char *parameter = NULL;
@@ -1156,7 +1154,7 @@ menuItemCloned(WEditMenuDelegate * delegate, WEditMenu * 
menu, WEditMenuItem * o
 
 #define DUP(s) (s) ? wstrdup(s) : NULL
 
-       newData = NEW(ItemData);
+       newData = wmalloc(sizeof(ItemData));
 
        newData->type = data->type;
 

-----------------------------------------------------------------------

Summary of changes:
 WINGs/string.c    |   12 ++-
 WPrefs.app/Menu.c |    8 +-
 WindowMaker/menu  |    8 +-
 src/appicon.c     |    5 +-
 src/appmenu.c     |    2 +-
 src/dock.c        |   11 +--
 src/rootmenu.c    |  293 ++++++++++++++++++++++-------------------------------
 src/usermenu.c    |    3 +-
 src/workspace.c   |    1 +
 9 files changed, 141 insertions(+), 202 deletions(-)


repo.or.cz automatic notification. Contact project admin crma...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to