]> granicus.if.org Git - postgresql/commitdiff
Port backup check on psql lexer to MSVC.
authorAndrew Dunstan <andrew@dunslane.net>
Thu, 25 Aug 2011 21:27:36 +0000 (17:27 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Thu, 25 Aug 2011 21:27:36 +0000 (17:27 -0400)
src/tools/msvc/pgflex.pl

index 332d422f6492ce9650d93582942d7eb9f9b0a5df..36636ccaf35fd91e2c5324878547b7ca9b4e0d12 100644 (file)
@@ -65,6 +65,20 @@ if ($? == 0)
         print $cfile $ccode;
         close($cfile);
     }
+       if ($flexflags =~ /\s-b\s/)
+       {
+               my $lexback = dirname($input) . "/lex.backup";
+               open($lfile,$lexback) || die "opening $lexback for reading: $!";
+               my $lexbacklines = <$lfile>;
+               close($lfile);
+               my $linecount = $lexbacklines =~ tr /\n/\n/;
+               if ($linecount != 1)
+               {
+                       print "Scanner requires backup, see lex.backup.\n";
+                       exit 1;
+               }
+               unlink $lexback;
+       }
 
     exit 0;