=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/cmd-string.c,v retrieving revision 1.24 retrieving revision 1.25 diff -c -r1.24 -r1.25 *** src/usr.bin/tmux/Attic/cmd-string.c 2016/10/14 22:14:22 1.24 --- src/usr.bin/tmux/Attic/cmd-string.c 2017/01/15 22:00:56 1.25 *************** *** 1,4 **** ! /* $OpenBSD: cmd-string.c,v 1.24 2016/10/14 22:14:22 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-string.c,v 1.25 2017/01/15 22:00:56 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 54,85 **** (*p)--; } ! /* ! * Parse command string. Returns -1 on error. If returning -1, cause is error ! * string, or NULL for empty command. ! */ ! int ! cmd_string_parse(const char *s, struct cmd_list **cmdlist, const char *file, ! u_int line, char **cause) { ! size_t p; ! int ch, i, argc, rval; ! char **argv, *buf, *t; ! const char *whitespace, *equals; ! size_t len; - argv = NULL; - argc = 0; - - buf = NULL; - len = 0; - *cause = NULL; - - *cmdlist = NULL; - rval = -1; - - p = 0; for (;;) { ch = cmd_string_getc(s, &p); switch (ch) { --- 54,70 ---- (*p)--; } ! struct cmd_list * ! cmd_string_parse(const char *s, const char *file, u_int line, char **cause) { ! size_t p = 0; ! int ch, i, argc = 0; ! char **argv = NULL, *buf = NULL, *t; ! const char *whitespace, *equals; ! size_t len = 0; ! struct cmd_list *cmdlist = NULL; *cause = NULL; for (;;) { ch = cmd_string_getc(s, &p); switch (ch) { *************** *** 133,144 **** if (argc == 0) goto out; ! *cmdlist = cmd_list_parse(argc, argv, file, line, ! cause); ! if (*cmdlist == NULL) ! goto out; ! ! rval = 0; goto out; case '~': if (buf == NULL) { --- 118,124 ---- if (argc == 0) goto out; ! cmdlist = cmd_list_parse(argc, argv, file, line, cause); goto out; case '~': if (buf == NULL) { *************** *** 171,177 **** free(argv); } ! return (rval); } static void --- 151,157 ---- free(argv); } ! return (cmdlist); } static void