diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-11-12 12:36:30 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-11-12 12:36:30 +0000 |
commit | 12806c8844a5aa6066b6f430924fef0b47170dae (patch) | |
tree | 3118223a7233e7253c35e10a538055f6e754882c /src/gui_w48.c | |
parent | 5a22181f59d01abb1c501ecf9580fd721751a62d (diff) | |
download | vim-git-12806c8844a5aa6066b6f430924fef0b47170dae.tar.gz |
updated for version 7.2-036v7.2.036
Diffstat (limited to 'src/gui_w48.c')
-rw-r--r-- | src/gui_w48.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui_w48.c b/src/gui_w48.c index 8b96f2b9c..53dbad112 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -3335,7 +3335,7 @@ gui_mch_browseW( /* * Convert the string s to the proper format for a filter string by replacing - * the \t and \n delimeters with \0. + * the \t and \n delimiters with \0. * Returns the converted string in allocated memory. * * Keep in sync with convert_filterW() above! @@ -3674,7 +3674,8 @@ _OnScroll( * Use "prog" as the name of the program and "cmdline" as the arguments. * Copy the arguments to allocated memory. * Return the number of arguments (including program name). - * Return pointers to the arguments in "argvp". + * Return pointers to the arguments in "argvp". Memory is allocated with + * malloc(), use free() instead of vim_free(). * Return pointer to buffer in "tofree". * Returns zero when out of memory. */ @@ -3692,6 +3693,8 @@ get_cmd_args(char *prog, char *cmdline, char ***argvp, char **tofree) char **argv = NULL; int round; + *tofree = NULL; + #ifdef FEAT_MBYTE /* Try using the Unicode version first, it takes care of conversion when * 'encoding' is changed. */ @@ -3802,15 +3805,15 @@ get_cmd_args(char *prog, char *cmdline, char ***argvp, char **tofree) argv = (char **)malloc((argc + 1) * sizeof(char *)); if (argv == NULL ) { - vim_free(newcmdline); + free(newcmdline); return 0; /* malloc error */ } pnew = newcmdline; + *tofree = newcmdline; } } done: - argv[argc] = NULL; /* NULL-terminated list */ *argvp = argv; return argc; |