projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4394c38
)
(expand): Use binary I/O where appropriate.
author
Jim Meyering
<jim@meyering.net>
Fri, 1 Jan 1999 22:27:36 +0000
(22:27 +0000)
committer
Jim Meyering
<jim@meyering.net>
Fri, 1 Jan 1999 22:27:36 +0000
(22:27 +0000)
src/expand.c
patch
|
blob
|
history
diff --git
a/src/expand.c
b/src/expand.c
index
7e31e03
..
84f589a
100644
(file)
--- a/
src/expand.c
+++ b/
src/expand.c
@@
-1,5
+1,5
@@
/* expand - convert tabs to spaces
/* expand - convert tabs to spaces
- Copyright (C) 89, 91,
95, 96, 1997, 1998
Free Software Foundation, Inc.
+ Copyright (C) 89, 91,
1995-1998, 1999
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-252,6
+252,10
@@
expand (void)
fp = next_file ((FILE *) NULL);
if (fp == NULL)
return;
fp = next_file ((FILE *) NULL);
if (fp == NULL)
return;
+
+ /* Binary I/O will preserve the original EOL style (DOS/Unix) of files. */
+ SET_BINARY2 (fileno (fp), STDOUT_FILENO);
+
for (;;)
{
c = getc (fp);
for (;;)
{
c = getc (fp);
@@
-261,7
+265,10
@@
expand (void)
if (fp == NULL)
break; /* No more files. */
else
if (fp == NULL)
break; /* No more files. */
else
- continue;
+ {
+ SET_BINARY2 (fileno (fp), STDOUT_FILENO);
+ continue;
+ }
}
if (c == '\n')
}
if (c == '\n')