Imported Upstream version 7.44.0
[platform/upstream/curl.git] / src / mkhelp.pl
index 444b669..088a09a 100644 (file)
@@ -6,7 +6,7 @@
 #                            | (__| |_| |  _ <| |___
 #                             \___|\___/|_| \_\_____|
 #
-# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
 #
 # This software is licensed as described in the file COPYING, which
 # you should have received as part of this distribution. The terms
@@ -54,6 +54,9 @@ while (<STDIN>) {
     # this should be removed:
     $line =~ s/(\b.|_\b)//g;
 
+    # remove trailing CR from line. msysgit checks out files as line+CRLF
+    $line =~ s/\r$//;
+
     if($line =~ /^([ \t]*\n|curl)/i) {
         # cut off headers and empty lines
         $wline++; # count number of cut off lines
@@ -90,7 +93,12 @@ open(READ, "<$README") ||
     die "couldn't read the README infile $README";
 
 while(<READ>) {
-    push @out, $_;
+    my $line = $_;
+
+    # remove trailing CR from line. msysgit checks out files as line+CRLF
+    $line =~ s/\r$//;
+
+    push @out, $line;
 }
 close(READ);
 
@@ -256,6 +264,10 @@ foot();
 
 sub foot {
   print <<FOOT
+#else /* !USE_MANUAL */
+/* built-in manual is disabled, blank function */
+#include "tool_hugehelp.h"
+void hugehelp(void) {}
 #endif /* USE_MANUAL */
 FOOT
   ;