PIDL: fix parsing linemarkers in preprocessor output
[samba.git] / pidl / lib / Parse / Pidl / IDL.pm
index d4820ffe92cdf7e97d5b49f336456841e5878c59..6927c892556b8bc6f5d174091b7e5c45d140b77e 100644 (file)
@@ -2576,7 +2576,9 @@ again:
 
        for ($parser->YYData->{INPUT}) {
                if (/^\#/) {
-                       if (s/^\# (\d+) \"(.*?)\"( \d+|)//) {
+                       # Linemarker format is described at
+                       # http://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html
+                       if (s/^\# (\d+) \"(.*?)\"(( \d+){1,4}|)//) {
                                $parser->YYData->{LINE} = $1-1;
                                $parser->YYData->{FILE} = $2;
                                goto again;