changeset 267:4c6bee98e002

fc-tmsh: support quoted strings for set-pcm-string
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 06 Feb 2014 01:40:02 +0000
parents cb833ff54d88
children debdb5f926d8
files rvinterf/tmsh/usercmd.c
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/tmsh/usercmd.c	Thu Feb 06 01:10:13 2014 +0000
+++ b/rvinterf/tmsh/usercmd.c	Thu Feb 06 01:40:02 2014 +0000
@@ -98,11 +98,22 @@
 			printf("error: too many arguments\n");
 			return;
 		}
-		*ap++ = cp;
-		while (*cp && !isspace(*cp))
-			cp++;
-		if (*cp)
+		if (*cp == '"') {
+			*ap++ = ++cp;
+			while (*cp && *cp != '"')
+				cp++;
+			if (*cp != '"') {
+				printf("error: unterminated quoted string\n");
+				return;
+			}
 			*cp++ = '\0';
+		} else {
+			*ap++ = cp;
+			while (*cp && !isspace(*cp))
+				cp++;
+			if (*cp)
+				*cp++ = '\0';
+		}
 	}
 	if (ap - argv - 1 < tp->minargs) {
 		printf("error: too few arguments\n");