[Pcsclite-cvs-commit] r6504 - /trunk/PCSC/src/tokenparser.l

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Wed Jan 16 14:22:27 UTC 2013


Author: rousseau
Date: Wed Jan 16 14:22:26 2013
New Revision: 6504

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6504
Log:
Convert all the & in &, not just the first occurence

Reader names may use more than one "&" character. 

Modified:
    trunk/PCSC/src/tokenparser.l

Modified: trunk/PCSC/src/tokenparser.l
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/tokenparser.l?rev=6504&op=diff
==============================================================================
--- trunk/PCSC/src/tokenparser.l (original)
+++ trunk/PCSC/src/tokenparser.l Wed Jan 16 14:22:26 2013
@@ -107,9 +107,9 @@
 
 	(void)strlcpy(value, &pcToken[8], len);
 
-	/* convert the first & into & */
-	amp = strstr(value, "&");
-	if (amp)
+	/* for all & in the string */
+	amp = value;
+	while ((amp = strstr(amp, "&")) != NULL)
 	{
 		char *p;
 
@@ -120,6 +120,9 @@
 		}
 		/* terminate the now shorter string */
 		*p = '\0';
+
+		/* skip the & and continue */
+		amp++;
 	}
 
 	r = list_append(list_values, value);




More information about the Pcsclite-cvs-commit mailing list