Changeset e56303f for cmd.c


Ignore:
Timestamp:
Mar 24, 2011, 4:00:33 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
f25df21
Parents:
42ee1be
git-author:
David Benjamin <davidben@mit.edu> (03/08/11 14:44:30)
git-committer:
David Benjamin <davidben@mit.edu> (03/24/11 16:00:33)
Message:
Replace owl_parse_delete with g_strfreev

Also cut the pointless g_strdup in owl_cmddict_execute and allow argc to
be NULL if we don't care about the value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    r3472845 re56303f  
    8585  char **argv;
    8686  int argc;
    87   char *tmpbuff;
    8887  char *retval = NULL;
    8988
    90   tmpbuff=g_strdup(cmdbuff);
    91   argv=owl_parseline(tmpbuff, &argc);
    92   if (argc < 0) {
    93     g_free(tmpbuff);
     89  argv = owl_parseline(cmdbuff, &argc);
     90  if (argv == NULL) {
    9491    owl_function_makemsg("Unbalanced quotes");
    9592    return NULL;
     
    9794 
    9895  if (argc < 1) {
    99     owl_parse_delete(argv, argc);
    100     g_free(tmpbuff);
     96    g_strfreev(argv);
    10197    return NULL;
    10298  }
     
    104100  retval = _owl_cmddict_execute(cd, ctx, strs(argv), argc, cmdbuff);
    105101
    106   owl_parse_delete(argv, argc);
    107   g_free(tmpbuff);
     102  g_strfreev(argv);
    108103  return retval;
    109104}
Note: See TracChangeset for help on using the changeset viewer.