Index: commands.c
===================================================================
--- commands.c	(revision b31f1c9929b526b6d90b18b7847a024ff3d0c77d)
+++ commands.c	(revision d275eb230e4d493acbb920b9bae25b692b199412)
@@ -1670,5 +1670,5 @@
   char *lastrv = NULL, *newbuff;
   char **commands;
-  int  ncommands, i;
+  int  i;
   if (argc < 2) {
     owl_function_makemsg("Invalid arguments to 'multi' command.");    
@@ -1688,6 +1688,6 @@
     }
   }
-  commands = atokenize(newbuff, ";", &ncommands);
-  for (i=0; i<ncommands; i++) {
+  commands = g_strsplit_set(newbuff, ";", 0);
+  for (i = 0; commands[i] != NULL; i++) {
     if (lastrv) {
       owl_free(lastrv);
@@ -1696,5 +1696,5 @@
   }
   owl_free(newbuff);
-  atokenize_delete(commands, ncommands);
+  g_strfreev(commands);
   return lastrv;
 }
Index: keybinding.c
===================================================================
--- keybinding.c	(revision 8a921b5e61689654774fef672165f4c56c01036d)
+++ keybinding.c	(revision d275eb230e4d493acbb920b9bae25b692b199412)
@@ -39,8 +39,8 @@
   int    nktokens, i;
 
-  ktokens = atokenize(keyseq, " ", &nktokens);
-  if (!ktokens) return(-1);
-  if (nktokens > OWL_KEYMAP_MAXSTACK) {
-    atokenize_delete(ktokens, nktokens);
+  ktokens = g_strsplit_set(keyseq, " ", 0);
+  nktokens = g_strv_length(ktokens);
+  if (nktokens < 1 || nktokens > OWL_KEYMAP_MAXSTACK) {
+    g_strfreev(ktokens);
     return(-1);
   }
@@ -48,6 +48,6 @@
   for (i=0; i<nktokens; i++) {
     kb->keys[i] = owl_keypress_fromstring(ktokens[i]);
-    if (kb->keys[i] == ERR) { 
-      atokenize_delete(ktokens, nktokens);
+    if (kb->keys[i] == ERR) {
+      g_strfreev(ktokens);
       owl_free(kb->keys);
       return(-1);
@@ -55,5 +55,5 @@
   }
   kb->len = nktokens;
-  atokenize_delete(ktokens, nktokens);
+  g_strfreev(ktokens);
   return(0);
 }
Index: util.c
===================================================================
--- util.c	(revision fa90c3462c6d1ec379b3b12056410a6c54216e4a)
+++ util.c	(revision d275eb230e4d493acbb920b9bae25b692b199412)
@@ -11,34 +11,4 @@
 #include <glib/gstdio.h>
 #include <glib-object.h>
-
-char **atokenize(const char *buffer, const char *sep, int *i)
-{
-  /* each element of return must be freed by user */
-  char **args;
-  char *workbuff, *foo;
-  int done=0, first=1, count=0;
-
-  workbuff = owl_strdup(buffer);
-
-  args=NULL;
-  while (!done) {
-    if (first) {
-      first=0;
-      foo=strtok(workbuff, sep);
-    } else {
-      foo=strtok(NULL, sep);
-    }
-    if (foo==NULL) {
-      done=1;
-    } else {
-      args=owl_realloc(args, sizeof(char *) * (count+1));
-      args[count] = owl_strdup(foo);
-      count++;
-    }
-  }
-  *i=count;
-  owl_free(workbuff);
-  return(args);
-}
 
 const char *skiptokens(const char *buff, int n) {
@@ -127,14 +97,4 @@
 }
 
-void atokenize_delete(char **tok, int nels)
-{
-  int i;
-  for (i=0; i<nels; i++) {
-    owl_free(tok[i]);
-  }
-  owl_free(tok);
-}
-
-
 void owl_parse_delete(char **argv, int argc)
 {
Index: variable.c
===================================================================
--- variable.c	(revision bc14adc19ef7abf1ba93d3e3e5e0714b188d084d)
+++ variable.c	(revision d275eb230e4d493acbb920b9bae25b692b199412)
@@ -952,7 +952,7 @@
   int nenums, val;
   if (newval == NULL) return(0);
-  enums = atokenize(v->validsettings, ",", &nenums);
-  if (enums == NULL) return(0);
-  atokenize_delete(enums, nenums);
+  enums = g_strsplit_set(v->validsettings, ",", 0);
+  nenums = g_strv_length(enums);
+  g_strfreev(enums);
   val = *(const int*)newval;
   if (val < 0 || val >= nenums) {
@@ -964,14 +964,13 @@
 int owl_variable_enum_set_fromstring(owl_variable *v, const char *newval) {
   char **enums;
-  int nenums, i, val=-1;
+  int i, val=-1;
   if (newval == NULL) return(-1);
-  enums = atokenize(v->validsettings, ",", &nenums);
-  if (enums == NULL) return(-1);
-  for (i=0; i<nenums; i++) {
+  enums = g_strsplit_set(v->validsettings, ",", 0);
+  for (i = 0; enums[i] != NULL; i++) {
     if (0==strcmp(newval, enums[i])) {
       val = i;
     }
   }
-  atokenize_delete(enums, nenums);
+  g_strfreev(enums);
   if (val == -1) return(-1);
   return (v->set_fn(v, &val));
@@ -986,13 +985,14 @@
     return -1;
   }
-  enums = atokenize(v->validsettings, ",", &nenums);
+  enums = g_strsplit_set(v->validsettings, ",", 0);
+  nenums = g_strv_length(enums);
   i = *(const int*)val;
   if (i<0 || i>=nenums) {
     snprintf(buf, bufsize, "<invalid:%d>",i);
-    atokenize_delete(enums, nenums);
+    g_strfreev(enums);
     return(-1);
   }
   snprintf(buf, bufsize, "%s", enums[i]);
-  atokenize_delete(enums, nenums);
+  g_strfreev(enums);
   return 0;
 }
