Skip to content

Commit 555ccdd

Browse files
committed
Avoid end-of-lines problem in generated shell scripts on Cygwin.
1 parent b12cf8e commit 555ccdd

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

ChangeLog

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2017-11-26 Bruno Haible <bruno@clisp.org>
2+
3+
Avoid end-of-lines problem in generated shell scripts on Cygwin.
4+
Patch by Feiyun Wang <feiyunw@yahoo.com>.
5+
* lib/genaliases.c (main): Create canonical.sh and canonical_local.sh
6+
with Unix end-of-line characters, regardless of Cygwin choice of
7+
text mode vs. binary mode.
8+
19
2017-07-15 Bruno Haible <bruno@clisp.org>
210

311
Allow building statically linked binaries, through LDFLAGS="-static".

lib/genaliases.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (C) 1999-2001, 2003, 2005, 2008, 2012 Free Software Foundation, Inc.
1+
/* Copyright (C) 1999-2001, 2003, 2005, 2008, 2012, 2017 Free Software Foundation, Inc.
22
This file is part of the GNU LIBICONV Library.
33
44
The GNU LIBICONV Library is free software; you can redistribute it
@@ -98,7 +98,7 @@ int main (int argc, char* argv[])
9898
#define BRACIFY(...) { __VA_ARGS__ }
9999
#define DEFALIAS(xxx_alias,xxx) emit_alias(aliases_file,xxx_alias,#xxx);
100100

101-
canonical_sh_file = fopen(canonical_sh_file_name, "w");
101+
canonical_sh_file = fopen(canonical_sh_file_name, "wb");
102102
if (canonical_sh_file == NULL) {
103103
fprintf(stderr, "Could not open '%s' for writing\n", canonical_sh_file_name);
104104
exit(1);
@@ -107,7 +107,7 @@ int main (int argc, char* argv[])
107107
if (ferror(canonical_sh_file) || fclose(canonical_sh_file))
108108
exit(1);
109109

110-
canonical_sh_file = fopen(canonical_local_sh_file_name, "w");
110+
canonical_sh_file = fopen(canonical_local_sh_file_name, "wb");
111111
if (canonical_sh_file == NULL) {
112112
fprintf(stderr, "Could not open '%s' for writing\n", canonical_local_sh_file_name);
113113
exit(1);

0 commit comments

Comments
 (0)