# HG changeset patch
# User Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
# Date 1391650802 0
# Node ID 4c6bee98e00268742994decf85c6d0d4069a418a
# Parent  cb833ff54d8885912e6bbf26b4b7f09e384e4594
fc-tmsh: support quoted strings for set-pcm-string

diff -r cb833ff54d88 -r 4c6bee98e002 rvinterf/tmsh/usercmd.c
--- 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");