Changeset 6a71113


Ignore:
Timestamp:
Mar 28, 2011, 9:11:12 AM (14 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
0b20de4, 4fd211f
Parents:
f203cad
git-author:
David Benjamin <davidben@mit.edu> (03/28/11 09:01:16)
git-committer:
David Benjamin <davidben@mit.edu> (03/28/11 09:11:12)
Message:
Use g_strjoinv in owl_cmddict_execute_argv, don't quote correctly

This reverts commit e3c8332fa85642544dba1222912b77cf6e32ce8c and uses
g_strjoinv instead. The correctly quoted form caused the j keybinding in
BarnOwl::Jabber to break. Without it, the world isn't sane this way
either:

  :perl BarnOwl::bindkey(recv => 'C-f C-f' => command => 'recv:next')

But a solution to this will probably be far more complex and bear little
relation to this commit. In the meantime master really shouldn't have
this obnoxious of a regression on it.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    rf25df21 r6a71113  
    9999
    100100char *owl_cmddict_execute_argv(const owl_cmddict *cd, const owl_context *ctx, const char *const *argv, int argc) {
    101   GString *buf = g_string_new("");
    102   int i;
    103   char *retval;
    104 
    105   /* We weren't given a command line, so fabricate a valid one. */
    106   for(i = 0; i < argc; i++) {
    107     if (i != 0)
    108       g_string_append_c(buf, ' ');
    109     owl_string_append_quoted_arg(buf, argv[i]);
    110   }
    111 
    112   retval = _owl_cmddict_execute(cd, ctx, argv, argc, buf->str);
    113 
    114   g_string_free(buf, true);
     101  char *buff;
     102  char *retval = NULL;
     103
     104  buff = g_strjoinv(" ", (char**)argv);
     105  retval = _owl_cmddict_execute(cd, ctx, argv, argc, buff);
     106  g_free(buff);
     107
    115108  return retval;
    116109}
  • perlglue.xs

    rf25df21 r6a71113  
    4343                        rv = owl_function_command(cmd);
    4444                } else {
    45                         argv = g_new(const char *, items + 1);
     45                        /* Ensure this is NULL-terminated. */
     46                        argv = g_new0(const char *, items + 1);
    4647                        argv[0] = cmd;
    4748                        for(i = 1; i < items; i++) {
Note: See TracChangeset for help on using the changeset viewer.