[patch] ppdep doesn't handle {$else} correctly
Original Reporter info from Mantis: Michalis @michaliskambi
-
Reporter name: Michalis Kamburelis
Original Reporter info from Mantis: Michalis @michaliskambi
- Reporter name: Michalis Kamburelis
Description:
If you use a construction like this:
{$ifdef SOMEDEF}
uses AlwaysUsed, Foo;
{$else}
uses AlwaysUsed, Bar;
{$endif}
then "ppdep" utility should either list "AlwaysUsed, Foo" when SOMEDEF is defined, or "AlwaysUsed, Bar" when it's not defined. But currently it doesn't, as the "{$else}" is not correctly understood:
---------------
$ ppdep a.pas
a.ppu: a.pas
$ ppdep -dSOMEDEF a.pas
a.ppu: a.pas \
alwaysused.ppu \
foo.ppu \
alwaysused.ppu \
bar.ppu
alwaysused.ppu: alwaysused.pas
foo.ppu: foo.pas
bar.ppu: bar.pas
---------------
Fixing it with the attached patch results in correct output:
--------------- $ ./ppdep-mod a.pas a.ppu: a.pas \ alwaysused.ppu \ bar.ppu
alwaysused.ppu: alwaysused.pas
bar.ppu: bar.pas
$ ./ppdep-mod -dSOMEDEF a.pas
a.ppu: a.pas \
alwaysused.ppu \
foo.ppu
alwaysused.ppu: alwaysused.pas
foo.ppu: foo.pas
---------------
I did this patch in response to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845504 . See the bugreport there for more comments.
Mantis conversion info:
- Mantis ID: 31007
- OS: Debian GNU/Linux
- OS Build: (testing)
- Build: 34959
- Platform: x86-64
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 34965 (#629d8277)
- Target version: 3.2.0