aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2015-02-19 19:20:35 -0800
committerPaul Eggert2015-02-19 19:21:32 -0800
commit3bbf5170722d9e555307259763623c74240a2555 (patch)
tree853912d230255ec479567a7feb0cb9d0506e9de4 /lib-src
parent12ab9571935d79c69ffab0fb1ea3f6e20f475860 (diff)
downloademacs-3bbf5170722d9e555307259763623c74240a2555.tar.gz
emacs-3bbf5170722d9e555307259763623c74240a2555.zip
Simplify binary I/O configuration
* lib-src/etags.c: Include <sysstdio.h> rather than <stdio.h>. (process_file_name, analyze_regex): Use FOPEN_BINARY rather than hard-coded "b". * src/lread.c (Fload): Prefer FOPEN_TEXT and FOPEN_BINARY to #ifdef DOS_NT. * src/sysstdio.h: Add copyright notice. Include <fcntl.h>. (FOPEN_BINARY, FOPEN_TEXT): New macros. * src/xfaces.c (Fx_load_color_file): Use FOPEN_TEXT, since POSIX doesn't guarantee that "t" will work.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog7
-rw-r--r--lib-src/etags.c15
2 files changed, 11 insertions, 11 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 05511164706..4ac9638102f 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,10 @@
12015-02-20 Paul Eggert <eggert@cs.ucla.edu>
2
3 Simplify binary I/O configuration
4 * etags.c: Include <sysstdio.h> rather than <stdio.h>.
5 (process_file_name, analyze_regex): Use FOPEN_BINARY rather than
6 hard-coded "b".
7
12015-02-19 Eli Zaretskii <eliz@gnu.org> 82015-02-19 Eli Zaretskii <eliz@gnu.org>
2 9
3 * etags.c (process_file_name) [!DOS_NT]: Use "r", not "rb" in the 10 * etags.c (process_file_name) [!DOS_NT]: Use "r", not "rb" in the
diff --git a/lib-src/etags.c b/lib-src/etags.c
index cdac9289230..7f1875547cf 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -122,7 +122,7 @@ char pot_etags_version[] = "@(#) pot revision number is 17.38.1.4";
122#include <stdarg.h> 122#include <stdarg.h>
123#include <stdlib.h> 123#include <stdlib.h>
124#include <string.h> 124#include <string.h>
125#include <stdio.h> 125#include <sysstdio.h>
126#include <ctype.h> 126#include <ctype.h>
127#include <errno.h> 127#include <errno.h>
128#include <sys/types.h> 128#include <sys/types.h>
@@ -1532,18 +1532,11 @@ process_file_name (char *file, language *lang)
1532 if (real_name == compressed_name) 1532 if (real_name == compressed_name)
1533 { 1533 {
1534 char *cmd = concat (compr->command, " ", real_name); 1534 char *cmd = concat (compr->command, " ", real_name);
1535 1535 inf = popen (cmd, "r" FOPEN_BINARY);
1536 /* Unix implementations of 'popen' generally don't support "rb", whereas
1537 DOS_NT needs it. */
1538#ifdef DOS_NT
1539 inf = popen (cmd, "rb");
1540#else
1541 inf = popen (cmd, "r");
1542#endif
1543 free (cmd); 1536 free (cmd);
1544 } 1537 }
1545 else 1538 else
1546 inf = fopen (real_name, "rb"); 1539 inf = fopen (real_name, "r" FOPEN_BINARY);
1547 if (inf == NULL) 1540 if (inf == NULL)
1548 { 1541 {
1549 perror (real_name); 1542 perror (real_name);
@@ -5607,7 +5600,7 @@ analyze_regex (char *regex_arg)
5607 char *regexfile = regex_arg + 1; 5600 char *regexfile = regex_arg + 1;
5608 5601
5609 /* regexfile is a file containing regexps, one per line. */ 5602 /* regexfile is a file containing regexps, one per line. */
5610 regexfp = fopen (regexfile, "rb"); 5603 regexfp = fopen (regexfile, "r" FOPEN_BINARY);
5611 if (regexfp == NULL) 5604 if (regexfp == NULL)
5612 pfatal (regexfile); 5605 pfatal (regexfile);
5613 linebuffer_init (&regexbuf); 5606 linebuffer_init (&regexbuf);