FreeCalypso > hg > freecalypso-sw
diff rvinterf/etmsync/dispatch.c @ 291:69e8ae2b5ba2
fc-fsio: fwrite implementation started
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sat, 01 Mar 2014 02:36:25 +0000 |
parents | 082d12a1651e |
children |
line wrap: on
line diff
--- a/rvinterf/etmsync/dispatch.c Fri Feb 28 23:41:53 2014 +0000 +++ b/rvinterf/etmsync/dispatch.c Sat Mar 01 02:36:25 2014 +0000 @@ -47,11 +47,23 @@ fprintf(stderr, "error: too many arguments\n"); return(ERROR_USAGE); } - *ap++ = cp; - while (*cp && !isspace(*cp)) - cp++; - if (*cp) + if (*cp == '"') { + *ap++ = ++cp; + while (*cp && *cp != '"') + cp++; + if (*cp != '"') { + fprintf(stderr, + "error: unterminated quoted string\n"); + return(ERROR_USAGE); + } *cp++ = '\0'; + } else { + *ap++ = cp; + while (*cp && !isspace(*cp)) + cp++; + if (*cp) + *cp++ = '\0'; + } } if (ap - argv - 1 < tp->minargs) { fprintf(stderr, "error: too few arguments\n");