summary refs log tree commit diff
path: root/Src/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/lex.c')
-rw-r--r--Src/lex.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/Src/lex.c b/Src/lex.c
index 5637a2106..6e14612f7 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -1802,16 +1802,18 @@ exalias(void)
 static int
 skipcomm(void)
 {
-    int pct = 1, c;
+    int pct = 1, c, start = 1;
 
     cmdpush(CS_CMDSUBST);
     SETPARBEGIN
     c = Inpar;
     do {
+	int iswhite;
 	add(c);
 	c = hgetc();
 	if (itok(c) || lexstop)
 	    break;
+	iswhite = isep(c);
 	switch (c) {
 	case '(':
 	    pct++;
@@ -1854,7 +1856,15 @@ skipcomm(void)
 		else
 		    add(c);
 	    break;
+	case '#':
+	    if (start) {
+		add(c);
+		while ((c = hgetc()) != '\n' && !lexstop)
+		    add(c);
+	    }
+	    break;
 	}
+	start = iswhite;
     }
     while (pct);
     if (!lexstop)