Changeset d275eb2 for commands.c


Ignore:
Timestamp:
Jan 2, 2011, 3:31:58 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
2bc6ad35
Parents:
f640876
git-author:
David Benjamin <davidben@mit.edu> (12/15/10 13:18:34)
git-committer:
David Benjamin <davidben@mit.edu> (01/02/11 15:31:58)
Message:
Replace atokenize with glib's g_strsplit_set

Glib's had g_strsplit_set since forever, and it does exactly the same
thing as atokenize, modulo needing a pesky NULL check. We may as well
use it.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    rb31f1c9 rd275eb2  
    16701670  char *lastrv = NULL, *newbuff;
    16711671  char **commands;
    1672   int  ncommands, i;
     1672  int  i;
    16731673  if (argc < 2) {
    16741674    owl_function_makemsg("Invalid arguments to 'multi' command.");   
     
    16881688    }
    16891689  }
    1690   commands = atokenize(newbuff, ";", &ncommands);
    1691   for (i=0; i<ncommands; i++) {
     1690  commands = g_strsplit_set(newbuff, ";", 0);
     1691  for (i = 0; commands[i] != NULL; i++) {
    16921692    if (lastrv) {
    16931693      owl_free(lastrv);
     
    16961696  }
    16971697  owl_free(newbuff);
    1698   atokenize_delete(commands, ncommands);
     1698  g_strfreev(commands);
    16991699  return lastrv;
    17001700}
Note: See TracChangeset for help on using the changeset viewer.