to '.'. There is a check that says that lines that start with a '.' are
not dependency lines; From: "Christos S. Zoulas" <christos>
SCCS-vsn: usr.bin/make/parse.c 5.20
-static char sccsid[] = "@(#)parse.c 5.19 (Berkeley) %G%";
+static char sccsid[] = "@(#)parse.c 5.20 (Berkeley) %G%";
#endif /* not lint */
/*-
#endif /* not lint */
/*-
static void ParseDoDependency __P((char *));
static int ParseAddCmd __P((GNode *, char *));
static int ParseReadc __P((void));
static void ParseDoDependency __P((char *));
static int ParseAddCmd __P((GNode *, char *));
static int ParseReadc __P((void));
+static void ParseUnreadc __P((int));
static int ParseHasCommands __P((GNode *));
static void ParseDoInclude __P((char *));
#ifdef SYSVINCLUDE
static int ParseHasCommands __P((GNode *));
static void ParseDoInclude __P((char *));
#ifdef SYSVINCLUDE
+
+/*-
+ *---------------------------------------------------------------------
+ * ParseUnreadc --
+ * Put back a character to the current file
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ *---------------------------------------------------------------------
+ */
+static void
+ParseUnreadc(c)
+ int c;
+{
+ if (curFILE) {
+ ungetc(c, curFILE);
+ return;
+ }
+ if (curPTR) {
+ *--(curPTR->ptr) = c;
+ return;
+ }
+}
+
+
/* ParseSkipLine():
* Grab the next line
*/
/* ParseSkipLine():
* Grab the next line
*/
for (;;) {
c = ParseReadc();
for (;;) {
c = ParseReadc();
- if ((c == '\t') || (c == '.')) {
ignComment = ignDepOp = TRUE;
break;
} else if (c == '\n') {
ignComment = ignDepOp = TRUE;
break;
} else if (c == '\n') {
} else {
/*
* Check for comments, semiNL's, etc. -- easier than
} else {
/*
* Check for comments, semiNL's, etc. -- easier than
- * ungetc(c, curFILE); continue;
+ * ParseUnreadc(c); continue;
* harm, since the newline remains in the buffer and the
* whole line is ignored.
*/
* harm, since the newline remains in the buffer and the
* whole line is ignored.
*/