renamce cstrtok to buffer2array. please don't rename functions; especially to names that look extremely std-lib-ish. also, don't use isspace, apparently it's local dependent and potentially consideres ' ' or '\t' not to be a space, or considers other characters to be a space.

git-svn-id: https://svn.musicpd.org/mpd/trunk@4574 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes
2006-08-06 13:53:53 +00:00
parent 31de97a42b
commit 8e53406774
6 changed files with 44 additions and 28 deletions

View File

@@ -31,6 +31,7 @@
#include "dbUtils.h"
#include "tag.h"
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
@@ -164,6 +165,9 @@ static void addCommand(char *name,
cmd->listHandler = listHandler_func;
cmd->reqPermission = reqPermission;
assert(minargs <= maxargs);
assert(maxargs <= COMMAND_ARGV_MAX);
insertInList(commandList, cmd->cmd, cmd);
}
@@ -1142,7 +1146,7 @@ static CommandEntry *getCommandEntryFromString(char *string, int *permission)
{
CommandEntry *cmd = NULL;
char *argv[COMMAND_ARGV_MAX] = { NULL };
int argc = cstrtok(string, argv, COMMAND_ARGV_MAX);
int argc = buffer2array(string, argv, COMMAND_ARGV_MAX);
if (0 == argc)
return NULL;
@@ -1161,7 +1165,7 @@ static int processCommandInternal(int fd, int *permission,
CommandEntry *cmd;
int ret = -1;
argc = cstrtok(commandString, argv, COMMAND_ARGV_MAX);
argc = buffer2array(commandString, argv, COMMAND_ARGV_MAX);
if (argc == 0)
return 0;