}
/* It's rather pointless to define a TAB separator with column
@@ -1279,11 +1410,11 @@ init_parameters (int number_of_files)
- TAB_WIDTH (chars_per_input_tab, chars_per_number); */
+ + TAB_WIDTH (chars_per_input_tab, chars_per_number); */
/* Estimate chars_per_text without any margin and keep it constant. */
- if (number_separator == '\t')
+ if (number_separator[0] == '\t')
- number_width = chars_per_number +
- TAB_WIDTH (chars_per_default_tab, chars_per_number);
+ number_width = (chars_per_number
+ + TAB_WIDTH (chars_per_default_tab, chars_per_number));
else
- number_width = chars_per_number + 1;
+ number_width = chars_per_number + number_separator_width;
@@ -1298,7 +1429,7 @@ init_parameters (int number_of_files)
}
- chars_per_column = (chars_per_line - chars_used_by_number -
-- (columns - 1) * col_sep_length) / columns;
-+ (columns - 1) * col_sep_width) / columns;
+ chars_per_column = (chars_per_line - chars_used_by_number
+- - (columns - 1) * col_sep_length) / columns;
++ - (columns - 1) * col_sep_width) / columns;
if (chars_per_column < 1)
error (EXIT_FAILURE, 0, _("page width too narrow"));
/* We've just printed some files and need to clean up things before
looking for more options and printing the next batch of files.
-diff -urNp coreutils-8.16-orig/src/sort.c coreutils-8.16/src/sort.c
---- coreutils-8.16-orig/src/sort.c 2012-03-24 21:26:51.000000000 +0100
-+++ coreutils-8.16/src/sort.c 2012-03-26 17:35:09.000000000 +0200
-@@ -22,11 +22,20 @@
+diff -urNp coreutils-8.17-orig/src/sort.c coreutils-8.17/src/sort.c
+--- coreutils-8.17-orig/src/sort.c
++++ coreutils-8.17/src/sort.c
+@@ -22,12 +22,21 @@
#include <config.h>
+#include <assert.h>
#include <getopt.h>
#include <pthread.h>
+ #include <sys/resource.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>