aboutsummaryrefslogtreecommitdiff
path: root/miscutils/ooqd.c
diff options
context:
space:
mode:
Diffstat (limited to 'miscutils/ooqd.c')
-rw-r--r--miscutils/ooqd.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/miscutils/ooqd.c b/miscutils/ooqd.c
index 85114c9..44721e9 100644
--- a/miscutils/ooqd.c
+++ b/miscutils/ooqd.c
@@ -116,9 +116,9 @@ static void skip_nonspace(char *cp, char **ncpp)
*ncpp= cp;
}
-static void find_eos(char *cp, char **ncpp)
+static void find_eos(char *cp, char **ncpp, char quote_char)
{
- while (cp[0] != '\0' && cp[0] != '"')
+ while (cp[0] != '\0' && cp[0] != quote_char)
cp++;
*ncpp= cp;
}
@@ -250,7 +250,7 @@ printf("got cp %p, line %p, '%s'\n", cp, line, cp);
if (cp[0] == '"')
{
/* Special code for strings */
- find_eos(cp+1, &ncp);
+ find_eos(cp+1, &ncp, '"');
if (ncp[0] != '"')
{
report(
@@ -263,6 +263,22 @@ printf("got cp %p, line %p, '%s'\n", cp, line, cp);
cp[0]= '\0';
cp++;
}
+ else if (cp[0] == '\'')
+ {
+ /* Also try single quotes */
+ find_eos(cp+1, &ncp, '\'');
+ if (ncp[0] != '\'')
+ {
+ report(
+ "command line '%s', end of string not found",
+ line);
+ continue; /* Just skip it */
+ }
+ argv[argc]= cp+1;
+ cp= ncp;
+ cp[0]= '\0';
+ cp++;
+ }
else
{
skip_nonspace(cp, &ncp);