Browse Source

Don't ignore first slash in param

Serj Kalichev 9 years ago
parent
commit
4f65a7323b
1 changed files with 5 additions and 10 deletions
  1. 5 10
      lub/argv/argv_nextword.c

+ 5 - 10
lub/argv/argv_nextword.c

@@ -15,17 +15,12 @@ const char *lub_argv_nextword(const char *string,
 
 	*quoted = 0;
 
-	/* find the start of a word (not including an opening quote) */
+	/* Find the start of a word (not including an opening quote) */
 	while (*string && isspace(*string)) {
 		string++;
 		(*offset)++;
 	}
-	if (*string == '\\') {
-		string++;
-		if (*string)
-			string++;
-	}
-	/* is this the start of a quoted string ? */
+	/* Is this the start of a quoted string ? */
 	if (*string == '"') {
 		*quoted = 1;
 		string++;
@@ -33,7 +28,7 @@ const char *lub_argv_nextword(const char *string,
 	word = string;
 	*len = 0;
 
-	/* find the end of the word */
+	/* Find the end of the word */
 	while (*string) {
 		if (*string == '\\') {
 			string++;
@@ -44,11 +39,11 @@ const char *lub_argv_nextword(const char *string,
 			}
 			continue;
 		}
-		/* end of word */
+		/* End of word */
 		if (!*quoted && isspace(*string))
 			break;
 		if (*string == '"') {
-			/* end of a quoted string */
+			/* End of a quoted string */
 			*quoted = 2;
 			break;
 		}