From efc7accc9dc187bc6dab9db6a08f8d5d1641d21f Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 27 Jul 2005 16:16:51 +0000 Subject: [PATCH] * gendef: Use nocr to remove \r's from input. gendef (nocr): New function. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/gendef | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 10f1f4f65..a24134135 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2005-07-27 Christopher Faylor + + * gendef: Use nocr to remove \r's from input. + gendef (nocr): New function. + 2005-07-27 Christopher Faylor * fhandler_clipboard.cc (fhandler_dev_clipboard::close): Set membuffer diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef index 83e9e1245..9d8a211e6 100755 --- a/winsup/cygwin/gendef +++ b/winsup/cygwin/gendef @@ -1,5 +1,6 @@ #!/usr/bin/perl use strict; +sub nocr(@); my $in = shift; my $tls_offsets = shift; my $out = shift; @@ -15,11 +16,11 @@ require $tls_offsets; open(IN, $in) or die "$0: couldn't open \"$in\" - $!\n"; my @top = (); while () { - push(@top, $_); + push(@top, nocr $_); last if /^\s*exports\s*$/i; } -my $libline = ; -my @in = ; +my $libline = nocr scalar(); +my @in = nocr ; close(IN); my %sigfe = (); @@ -349,3 +350,7 @@ _longjmp: ret EOF } + +sub nocr(@) { + map {s/\r//g; $_} @_; +} -- 2.43.5