p2 = p;
files = multi_glob (parse_file_seq (&p2, '\0',
sizeof (struct nameseq)),
- sizeof (struct nameseq));
+ sizeof (struct nameseq),
+ 1);
free (p);
/* Save the state of conditionals and start
filenames = multi_glob (parse_file_seq (&p2, ':',
sizeof (struct nameseq)),
- sizeof (struct nameseq));
+ sizeof (struct nameseq),
+ 1);
if (*p2++ == '\0')
makefile_fatal (filename, lineno, "missing separator");
/* Is this a one-colon or two-colon entry? */
if (p != 0)
{
struct nameseq *target;
- target = parse_file_seq (&p2, ':', sizeof (struct nameseq));
+ target = parse_file_seq (&p2, ':', sizeof (struct nameseq), 1);
++p2;
if (target == 0)
makefile_fatal (filename, lineno, "missing target pattern");
/* Parse the dependencies. */
deps = (struct dep *)
multi_glob (parse_file_seq (&p2, '\0', sizeof (struct dep)),
- sizeof (struct dep));
+ sizeof (struct dep),
+ 1);
commands_idx = 0;
if (cmdleft != 0)
SIZE is how big to construct chain elements.
This is useful if we want them actually to be other structures
- that have room for additional info. */
+ that have room for additional info.
+
+ If STRIP is nonzero, strip `./'s off the beginning. */
struct nameseq *
-parse_file_seq (stringp, stopchar, size)
+parse_file_seq (stringp, stopchar, size, strip)
char **stringp;
char stopchar;
unsigned int size;
+ int strip;
{
register struct nameseq *new = 0;
register struct nameseq *new1;
}
p--;
- /* Skip leading `./'s. */
- while (p - q > 2 && q[0] == '.' && q[1] == '/')
- {
- q += 2; /* Skip "./". */
- while (q < p && *q == '/')
- /* Skip following slashes: ".//foo" is "foo", not "/foo". */
- ++q;
- }
+ if (strip)
+ /* Skip leading `./'s. */
+ while (p - q > 2 && q[0] == '.' && q[1] == '/')
+ {
+ q += 2; /* Skip "./". */
+ while (q < p && *q == '/')
+ /* Skip following slashes: ".//foo" is "foo", not "/foo". */
+ ++q;
+ }
/* Extract the filename just found, and skip it. */