aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <ghudson@mit.edu>2023-10-23 18:29:14 -0700
committerGreg Hudson <ghudson@mit.edu>2023-10-30 22:14:07 -0400
commitc20251dafd6120fa08c76b19315cb9deb1a1b24e (patch)
treedd6458082948319a6bc250572f52009d0369a4a7
parent6436a3808061da787a43c6810f5f0370cdfb6e36 (diff)
downloadkrb5-c20251dafd6120fa08c76b19315cb9deb1a1b24e.zip
krb5-c20251dafd6120fa08c76b19315cb9deb1a1b24e.tar.gz
krb5-c20251dafd6120fa08c76b19315cb9deb1a1b24e.tar.bz2
Make def-check.pl work with Windows git-bash perl
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.
-rw-r--r--src/util/def-check.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/util/def-check.pl b/src/util/def-check.pl
index ccdf8ef..2f48c02 100644
--- a/src/util/def-check.pl
+++ b/src/util/def-check.pl
@@ -40,12 +40,12 @@ my $vararg;
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:
@@ -79,7 +79,7 @@ while (! $h->eof()) {
$_ .= " ";
$len1 = length;
$_ .= $h->getline();
- chop if $len1 < length;
+ s/(\r)?\n$// if $len1 < length;
goto Cloop1 if /\/\*./;
}
# blank lines
@@ -101,7 +101,7 @@ while (! $h->eof()) {
$_ .= "\n";
$len1 = length;
$_ .= $h->getline();
- chop if $len1 < length;
+ s/(\r)?\n$// if $len1 < length;
goto Struct1;
}
Semi:
@@ -109,7 +109,7 @@ while (! $h->eof()) {
$_ .= "\n";
$len1 = length;
$_ .= $h->getline();
- chop if $len1 < length;
+ s/(\r)?\n$// if $len1 < length;
s/\n/ /g;
s/[ \t]+/ /g;
s/^[ \t]*//;
@@ -212,7 +212,7 @@ if (!$d) {
LINE2:
while (! $d->eof()) {
$_ = $d->getline();
- chop;
+ s/[\r\n]+$//;
#
if (/^;/) {
$printit = 0;