gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 90/173: cmdline-opts/gen.pl: Open input files in CR


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 90/173: cmdline-opts/gen.pl: Open input files in CRLF mode
Date: Fri, 24 Feb 2017 14:01:52 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to annotated tag gnurl-7.53.1
in repository gnurl.

commit d0837f36dbe476fd9535fee3f2b0e2599031404d
Author: Jay Satiro <address@hidden>
AuthorDate: Mon Jan 16 18:26:08 2017 -0500

    cmdline-opts/gen.pl: Open input files in CRLF mode
    
    On Windows it's possible to have input files with CRLF line endings and
    a perl that defaults to LF line endings (eg msysgit). Currently that
    results in generator output of mixed line endings of CR, LF and CRLF.
    
    This change fixes that issue in the most succinct way by opening the
    files in :crlf text mode even when the perl being used does not default
    to that mode. (On operating systems that don't have a separate text mode
    it's essentially a no-op.) The output continues to be in the perl's
    native line ending.
---
 docs/cmdline-opts/gen.pl      | 22 +++++++++++++++++++---
 docs/cmdline-opts/use-ascii.d |  2 +-
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/docs/cmdline-opts/gen.pl b/docs/cmdline-opts/gen.pl
index c8b129360..89a5df845 100755
--- a/docs/cmdline-opts/gen.pl
+++ b/docs/cmdline-opts/gen.pl
@@ -1,5 +1,21 @@
 #!/usr/bin/perl
 
+=begin comment
+
+This script generates the manpage.
+
+Example: gen.pl mainpage > curl.1
+
+Dev notes:
+
+We open *input* files in :crlf translation (a no-op on many platforms) in
+case we have CRLF line endings in Windows but a perl that defaults to LF.
+Unfortunately it seems some perls like msysgit can't handle a global input-only
+:crlf so it has to be specified on each file open for text input.
+
+=end comment
+=cut
+
 my $some_dir=".";
 
 opendir(my $dh, $some_dir) || die "Can't opendir $some_dir: $!";
@@ -85,7 +101,7 @@ sub added {
 
 sub single {
     my ($f, $standalone)address@hidden;
-    open(F, "<$f") ||
+    open(F, "<:crlf", "$f") ||
         return 1;
     my $short;
     my $long;
@@ -219,7 +235,7 @@ sub single {
 
 sub getshortlong {
     my ($f)address@hidden;
-    open(F, "<$f");
+    open(F, "<:crlf", "$f");
     my $short;
     my $long;
     my $help;
@@ -265,7 +281,7 @@ sub indexoptions {
 
 sub header {
     my ($f)address@hidden;
-    open(F, "<$f");
+    open(F, "<:crlf", "$f");
     my @d;
     while(<F>) {
         push @d, $_;
diff --git a/docs/cmdline-opts/use-ascii.d b/docs/cmdline-opts/use-ascii.d
index da307dc4d..d59fad922 100644
--- a/docs/cmdline-opts/use-ascii.d
+++ b/docs/cmdline-opts/use-ascii.d
@@ -3,6 +3,6 @@ Long: use-ascii
 Help: Use ASCII/text transfer
 Protocols: FTP LDAP
 ---
-Enable ASCII transfer. For FTP, this can also be enforced by using an URL that
+Enable ASCII transfer. For FTP, this can also be enforced by using a URL that
 ends with ";type=A". This option causes data sent to stdout to be in text mode
 for win32 systems.

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]