summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-08-24 07:36:36 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-08-24 07:36:36 +0000
commit59cf3747e3045a1cb778f502c5864a5881f1d60e (patch)
treef79f379b02f0c6d515c7dfeab34c54de03fe74bb
parent30e41c2ddc0f3f1067a486e5f8554a3e2657de0e (diff)
downloadcoreutils-59cf3747e3045a1cb778f502c5864a5881f1d60e.tar.xz
POSIX-conformance fixes for "expand" and "unexpand".
-rw-r--r--ChangeLog29
-rw-r--r--NEWS5
-rw-r--r--doc/ChangeLog10
3 files changed, 44 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c3971f86..93fe1186a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2004-08-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ POSIX-conformance fixes for "expand" and "unexpand".
+ Also, consistently use "tab stop" rather than "tabstop".
+ * NEWS: Document fixes.
+ * src/expand.c: Revamp to resemble the new unexpand.c better.
+ (usage): -i does not convert tabs after non-tabs.
+ (add_tab_stop): Renamed from add_tabstop. All uses changed.
+ (parse_tab_stop): Renamed from parse_tabstop. All uses changed.
+ (validate_tab_stop): Renamed from validate_tabstop. All uses changed.
+ (next_file, main): Check fclose against 0, not EOF.
+ (expand): Remove unnecessary casts.
+ Add another loop nesting level, for lines, so that per-line variables
+ are initialized cleanly.
+ Revamp tab checking. Check for write error immediately, rather
+ than just once at the end of the program.
+ * src/unexpand.c: Lkewise (for the expand.c changes).
+ (TAB_STOP_SENTINEL): Remove.
+ (tab_size): Now size_t, not uintmax_t, since we need to store
+ the sequences of blanks.
+ (max_column_width): New var.
+ (usage): Say "blank" where POSIX requires this.
+ (add_tab_stop): Calculate maximum column width.
+ (unexpand): Store the pending blanks, instead of merely counting them.
+ Follow POSIX's rules about -a requiring two blanks before a tab stop.
+ Get rid of internal label and goto.
+ * tests/unexpand/basic-1: Fix infloop-3 to match POSIX.
+ Add blanks-1 through blanks-13.
+
2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
* NEWS: "chown : file", "chown '' file", and "chgrp '' file" now
diff --git a/NEWS b/NEWS
index 4c4f6ca59..f2cdc009f 100644
--- a/NEWS
+++ b/NEWS
@@ -85,6 +85,11 @@ GNU coreutils NEWS -*- outline -*-
POSIXLY_CORRECT is set and the first argument is not "-n", echo now
outputs all option-like arguments instead of treating them as options.
+ expand and unexpand now conform to POSIX better. They check for
+ blanks (which can include characters other than space and tab in
+ non-POSIX locales) instead of spaces and tabs. Unexpand now
+ preserves some blanks instead of converting them to tabs or spaces.
+
printf has several changes:
It now uses 'intmax_t' (not 'long int') to format integers, so it
diff --git a/doc/ChangeLog b/doc/ChangeLog
index f36958afc..7243ecf55 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,13 @@
+2004-08-24 Paul Eggert <eggert@cs.ucla.edu>
+
+ POSIX-conformance fixes for "expand" and "unexpand".
+ * coreutils.texi: Standardize on "tab stop" (the POSIX usage)
+ rather than "tabstop".
+ (unexpand invocation): Use "blank" rather than "space" when
+ POSIX requires "blank". Define "blank". Initial blanks are
+ converted even if there's just one. For -a, convert two or
+ more blanks only if they occur just before a tab stop.
+
2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
* coreutils.texi (chown invocation): Fix synopsis: