shithub: mc

Download patch

ref: 3f5de2514eb4a90a8f7925bbeaf6dfdfb07debf8
parent: e24e91ebc63ac6dd4bdd6e7408e157c33f2d76e0
author: Ori Bernstein <ori@markovcorp.com>
date: Thu Dec 20 09:46:18 EST 2018

Ignore shebang lines in the compiler.

--- a/parse/tok.c
+++ b/parse/tok.c
@@ -880,6 +880,15 @@
 	curloc.line = 1;
 	curloc.file = 0;
 	close(fd);
+	if(fbufsz > 2 && fbuf[0] == '#' && fbuf[1] == '!') {
+		for (fidx = 0; fidx < fbufsz; fidx++)  {
+			if(fbuf[fidx] == '\n') {
+				curloc.line++;
+				fidx++;
+				break;
+			}
+		}
+	}
 	filename = strdup(file);
 }