Skip to content

Commit

Permalink
Make def-check.pl work with Windows git-bash perl
Browse files Browse the repository at this point in the history
The version of Perl included in git-bash does not translate line
endings or filter out the end-of-file marker when reading from files
in text mode.  Adjust def-check.pl to work in this environment.
  • Loading branch information
greghudson committed Oct 31, 2023
1 parent 6436a38 commit c20251d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/util/def-check.pl
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ sub open_always
LINE:
while (! $h->eof()) {
$_ = $h->getline();
chop;
s/(\r)?\n$//;
# get calling convention info for function decls
# what about function pointer typedefs?
# need to verify unhandled syntax actually triggers a report, not ignored
# blank lines
if (/^[ \t]*$/) {
if (/^[ \t\cZ]*$/) {
next LINE;
}
Top:
Expand Down Expand Up @@ -79,7 +79,7 @@ sub open_always
$_ .= " ";
$len1 = length;
$_ .= $h->getline();
chop if $len1 < length;
s/(\r)?\n$// if $len1 < length;
goto Cloop1 if /\/\*./;
}
# blank lines
Expand All @@ -101,15 +101,15 @@ sub open_always
$_ .= "\n";
$len1 = length;
$_ .= $h->getline();
chop if $len1 < length;
s/(\r)?\n$// if $len1 < length;
goto Struct1;
}
Semi:
unless (/;/) {
$_ .= "\n";
$len1 = length;
$_ .= $h->getline();
chop if $len1 < length;
s/(\r)?\n$// if $len1 < length;
s/\n/ /g;
s/[ \t]+/ /g;
s/^[ \t]*//;
Expand Down Expand Up @@ -212,7 +212,7 @@ sub open_always
LINE2:
while (! $d->eof()) {
$_ = $d->getline();
chop;
s/[\r\n]+$//;
#
if (/^;/) {
$printit = 0;
Expand Down

0 comments on commit c20251d

Please sign in to comment.