mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 14:08:06 +01:00
added wtokennext()
This commit is contained in:
@@ -242,6 +242,8 @@ char *wstrappend(char *dst, char *src);
|
|||||||
|
|
||||||
void wtokensplit(char *command, char ***argv, int *argc);
|
void wtokensplit(char *command, char ***argv, int *argc);
|
||||||
|
|
||||||
|
char *wtokennext(char *word, char **next);
|
||||||
|
|
||||||
char *wtokenjoin(char **list, int count);
|
char *wtokenjoin(char **list, int count);
|
||||||
|
|
||||||
void wtokenfree(char **tokens, int count);
|
void wtokenfree(char **tokens, int count);
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ static DFA mtable[9][6] = {
|
|||||||
{{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
|
{{-1,-1},{0,0},{0,0},{0,0},{0,0},{0,0}}, /* final state */
|
||||||
};
|
};
|
||||||
|
|
||||||
static char*
|
char*
|
||||||
next_token(char *word, char **next)
|
wtokennext(char *word, char **next)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
char *ret, *t;
|
char *ret, *t;
|
||||||
@@ -95,7 +95,7 @@ wtokensplit(char *command, char ***argv, int *argc)
|
|||||||
count = 0;
|
count = 0;
|
||||||
line = command;
|
line = command;
|
||||||
do {
|
do {
|
||||||
token = next_token(line, &line);
|
token = wtokennext(line, &line);
|
||||||
if (token) {
|
if (token) {
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
*argv = wmalloc(sizeof(char**));
|
*argv = wmalloc(sizeof(char**));
|
||||||
|
|||||||
Reference in New Issue
Block a user