diff options
author | ru <ru@FreeBSD.org> | 2004-01-25 12:28:36 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2004-01-25 12:28:36 +0000 |
commit | f02f4e8406d62a134af6ba8e6519cdd75e312067 (patch) | |
tree | 1da79c22bbd6d71d8529ad1ce1432a5ffd2a1bfa /usr.bin/make/str.c | |
parent | f4ceb3a98de64552bc6b2e619cbc530c963cfa64 (diff) | |
download | FreeBSD-src-f02f4e8406d62a134af6ba8e6519cdd75e312067.zip FreeBSD-src-f02f4e8406d62a134af6ba8e6519cdd75e312067.tar.gz |
Fixed a bug that previous revision has introduced -- we missed
the double quotes ("" and '') as a separate argument.
Reported by: ache
The fix in this and previous revisions combined is functionally
equivalent to the below patch against rev. 1.27 but the code is
now much easier to follow:
%%%
Index: str.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/make/str.c,v
retrieving revision 1.27
diff -u -r1.27 str.c
--- str.c 28 Oct 2002 23:33:57 -0000 1.27
+++ str.c 25 Jan 2004 12:09:21 -0000
@@ -168,7 +168,7 @@
inquote = (char) ch;
/* Don't miss "" or '' */
if (start == NULL && p[1] == inquote) {
- start = t + 1;
+ start = t;
break;
}
}
%%%
Diffstat (limited to 'usr.bin/make/str.c')
-rw-r--r-- | usr.bin/make/str.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c index 23fc835..1aa54f7 100644 --- a/usr.bin/make/str.c +++ b/usr.bin/make/str.c @@ -160,10 +160,12 @@ brk_string(char *str, int *store_argc, Boolean expand) case '"': case '\'': if (inquote) { - if (ch == inquote) - inquote = '\0'; - else + if (ch != inquote) break; + inquote = '\0'; + /* Don't miss "" or '' */ + if (!start) + start = t; } else inquote = (char) ch; if (expand) |