This commit is contained in:
parent
769ab9e681
commit
0f9cd3e7de
@ -1,5 +1,5 @@
|
|||||||
--- coreutils-6.11/lib/linebuffer.h
|
--- coreutils-6.12/lib/linebuffer.h
|
||||||
+++ coreutils-6.11/lib/linebuffer.h
|
+++ coreutils-6.12/lib/linebuffer.h
|
||||||
@@ -21,6 +21,11 @@
|
@@ -21,6 +21,11 @@
|
||||||
|
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
@ -22,8 +22,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Initialize linebuffer LINEBUFFER for use. */
|
/* Initialize linebuffer LINEBUFFER for use. */
|
||||||
--- coreutils-6.11/src/cut.c
|
--- coreutils-6.12/src/cut.c
|
||||||
+++ coreutils-6.11/src/cut.c
|
+++ coreutils-6.12/src/cut.c
|
||||||
@@ -28,6 +28,12 @@
|
@@ -28,6 +28,12 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -51,7 +51,7 @@
|
|||||||
/* The official name of this program (e.g., no `g' prefix). */
|
/* The official name of this program (e.g., no `g' prefix). */
|
||||||
#define PROGRAM_NAME "cut"
|
#define PROGRAM_NAME "cut"
|
||||||
|
|
||||||
@@ -74,6 +87,54 @@ struct range_pair
|
@@ -77,6 +90,54 @@ struct range_pair
|
||||||
size_t hi;
|
size_t hi;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -106,7 +106,7 @@
|
|||||||
/* This buffer is used to support the semantics of the -s option
|
/* This buffer is used to support the semantics of the -s option
|
||||||
(or lack of same) when the specified field list includes (does
|
(or lack of same) when the specified field list includes (does
|
||||||
not include) the first field. In both of those cases, the entire
|
not include) the first field. In both of those cases, the entire
|
||||||
@@ -86,7 +147,7 @@ static char *field_1_buffer;
|
@@ -89,7 +150,7 @@ static char *field_1_buffer;
|
||||||
/* The number of bytes allocated for FIELD_1_BUFFER. */
|
/* The number of bytes allocated for FIELD_1_BUFFER. */
|
||||||
static size_t field_1_bufsize;
|
static size_t field_1_bufsize;
|
||||||
|
|
||||||
@ -115,7 +115,7 @@
|
|||||||
or degenerate range specification; this doesn't include the starting
|
or degenerate range specification; this doesn't include the starting
|
||||||
index of right-open-ended ranges. For example, with either range spec
|
index of right-open-ended ranges. For example, with either range spec
|
||||||
`2-5,9-', `2-3,5,9-' this variable would be set to 5. */
|
`2-5,9-', `2-3,5,9-' this variable would be set to 5. */
|
||||||
@@ -98,10 +159,11 @@ static size_t eol_range_start;
|
@@ -101,10 +162,11 @@ static size_t eol_range_start;
|
||||||
|
|
||||||
/* This is a bit vector.
|
/* This is a bit vector.
|
||||||
In byte mode, which bytes to output.
|
In byte mode, which bytes to output.
|
||||||
@ -129,7 +129,7 @@
|
|||||||
(K <= MAX_RANGE_ENDPOINT and is_printable_field(K))
|
(K <= MAX_RANGE_ENDPOINT and is_printable_field(K))
|
||||||
|| (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */
|
|| (EOL_RANGE_START > 0 && K >= EOL_RANGE_START). */
|
||||||
static unsigned char *printable_field;
|
static unsigned char *printable_field;
|
||||||
@@ -110,9 +172,12 @@ enum operating_mode
|
@@ -113,9 +175,12 @@ enum operating_mode
|
||||||
{
|
{
|
||||||
undefined_mode,
|
undefined_mode,
|
||||||
|
|
||||||
@ -143,7 +143,7 @@
|
|||||||
/* Output the given delimeter-separated fields. */
|
/* Output the given delimeter-separated fields. */
|
||||||
field_mode
|
field_mode
|
||||||
};
|
};
|
||||||
@@ -122,6 +187,13 @@ char *program_name;
|
@@ -125,6 +190,13 @@ char *program_name;
|
||||||
|
|
||||||
static enum operating_mode operating_mode;
|
static enum operating_mode operating_mode;
|
||||||
|
|
||||||
@ -157,7 +157,7 @@
|
|||||||
/* If true do not output lines containing no delimeter characters.
|
/* If true do not output lines containing no delimeter characters.
|
||||||
Otherwise, all such lines are printed. This option is valid only
|
Otherwise, all such lines are printed. This option is valid only
|
||||||
with field mode. */
|
with field mode. */
|
||||||
@@ -133,6 +205,9 @@ static bool complement;
|
@@ -136,6 +208,9 @@ static bool complement;
|
||||||
|
|
||||||
/* The delimeter character for field mode. */
|
/* The delimeter character for field mode. */
|
||||||
static unsigned char delim;
|
static unsigned char delim;
|
||||||
@ -167,7 +167,7 @@
|
|||||||
|
|
||||||
/* True if the --output-delimiter=STRING option was specified. */
|
/* True if the --output-delimiter=STRING option was specified. */
|
||||||
static bool output_delimiter_specified;
|
static bool output_delimiter_specified;
|
||||||
@@ -206,7 +281,7 @@ Mandatory arguments to long options are
|
@@ -209,7 +284,7 @@ Mandatory arguments to long options are
|
||||||
-f, --fields=LIST select only these fields; also print any line\n\
|
-f, --fields=LIST select only these fields; also print any line\n\
|
||||||
that contains no delimiter character, unless\n\
|
that contains no delimiter character, unless\n\
|
||||||
the -s option is specified\n\
|
the -s option is specified\n\
|
||||||
@ -176,7 +176,7 @@
|
|||||||
"), stdout);
|
"), stdout);
|
||||||
fputs (_("\
|
fputs (_("\
|
||||||
--complement complement the set of selected bytes, characters\n\
|
--complement complement the set of selected bytes, characters\n\
|
||||||
@@ -365,7 +440,7 @@ set_fields (const char *fieldstr)
|
@@ -368,7 +443,7 @@ set_fields (const char *fieldstr)
|
||||||
in_digits = false;
|
in_digits = false;
|
||||||
/* Starting a range. */
|
/* Starting a range. */
|
||||||
if (dash_found)
|
if (dash_found)
|
||||||
@ -185,7 +185,7 @@
|
|||||||
dash_found = true;
|
dash_found = true;
|
||||||
fieldstr++;
|
fieldstr++;
|
||||||
|
|
||||||
@@ -388,7 +463,9 @@ set_fields (const char *fieldstr)
|
@@ -392,7 +467,9 @@ set_fields (const char *fieldstr)
|
||||||
if (!rhs_specified)
|
if (!rhs_specified)
|
||||||
{
|
{
|
||||||
/* `n-'. From `initial' to end of line. */
|
/* `n-'. From `initial' to end of line. */
|
||||||
@ -196,7 +196,7 @@
|
|||||||
field_found = true;
|
field_found = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -485,7 +562,7 @@ set_fields (const char *fieldstr)
|
@@ -489,7 +566,7 @@ set_fields (const char *fieldstr)
|
||||||
fieldstr++;
|
fieldstr++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -205,7 +205,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
max_range_endpoint = 0;
|
max_range_endpoint = 0;
|
||||||
@@ -578,6 +655,81 @@ cut_bytes (FILE *stream)
|
@@ -582,6 +659,81 @@ cut_bytes (FILE *stream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +287,7 @@
|
|||||||
/* Read from stream STREAM, printing to standard output any selected fields. */
|
/* Read from stream STREAM, printing to standard output any selected fields. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -700,13 +852,190 @@ cut_fields (FILE *stream)
|
@@ -704,13 +856,190 @@ cut_fields (FILE *stream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -481,7 +481,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Process file FILE to standard output.
|
/* Process file FILE to standard output.
|
||||||
@@ -756,6 +1085,8 @@ main (int argc, char **argv)
|
@@ -760,6 +1089,8 @@ main (int argc, char **argv)
|
||||||
bool ok;
|
bool ok;
|
||||||
bool delim_specified = false;
|
bool delim_specified = false;
|
||||||
char *spec_list_string IF_LINT(= NULL);
|
char *spec_list_string IF_LINT(= NULL);
|
||||||
@ -490,7 +490,7 @@
|
|||||||
|
|
||||||
initialize_main (&argc, &argv);
|
initialize_main (&argc, &argv);
|
||||||
program_name = argv[0];
|
program_name = argv[0];
|
||||||
@@ -778,7 +1109,6 @@ main (int argc, char **argv)
|
@@ -782,7 +1113,6 @@ main (int argc, char **argv)
|
||||||
switch (optc)
|
switch (optc)
|
||||||
{
|
{
|
||||||
case 'b':
|
case 'b':
|
||||||
@ -498,7 +498,7 @@
|
|||||||
/* Build the byte list. */
|
/* Build the byte list. */
|
||||||
if (operating_mode != undefined_mode)
|
if (operating_mode != undefined_mode)
|
||||||
FATAL_ERROR (_("only one type of list may be specified"));
|
FATAL_ERROR (_("only one type of list may be specified"));
|
||||||
@@ -786,6 +1116,14 @@ main (int argc, char **argv)
|
@@ -790,6 +1120,14 @@ main (int argc, char **argv)
|
||||||
spec_list_string = optarg;
|
spec_list_string = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -513,7 +513,7 @@
|
|||||||
case 'f':
|
case 'f':
|
||||||
/* Build the field list. */
|
/* Build the field list. */
|
||||||
if (operating_mode != undefined_mode)
|
if (operating_mode != undefined_mode)
|
||||||
@@ -797,9 +1135,32 @@ main (int argc, char **argv)
|
@@ -801,9 +1139,32 @@ main (int argc, char **argv)
|
||||||
case 'd':
|
case 'd':
|
||||||
/* New delimiter. */
|
/* New delimiter. */
|
||||||
/* Interpret -d '' to mean `use the NUL byte as the delimiter.' */
|
/* Interpret -d '' to mean `use the NUL byte as the delimiter.' */
|
||||||
@ -549,7 +549,7 @@
|
|||||||
delim_specified = true;
|
delim_specified = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -813,6 +1174,7 @@ main (int argc, char **argv)
|
@@ -817,6 +1178,7 @@ main (int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
@ -557,7 +557,7 @@
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
@@ -835,7 +1197,7 @@ main (int argc, char **argv)
|
@@ -839,7 +1201,7 @@ main (int argc, char **argv)
|
||||||
if (operating_mode == undefined_mode)
|
if (operating_mode == undefined_mode)
|
||||||
FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
|
FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
|
||||||
|
|
||||||
@ -566,7 +566,7 @@
|
|||||||
FATAL_ERROR (_("an input delimiter may be specified only\
|
FATAL_ERROR (_("an input delimiter may be specified only\
|
||||||
when operating on fields"));
|
when operating on fields"));
|
||||||
|
|
||||||
@@ -862,15 +1224,34 @@ main (int argc, char **argv)
|
@@ -866,15 +1228,34 @@ main (int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!delim_specified)
|
if (!delim_specified)
|
||||||
@ -607,8 +607,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (optind == argc)
|
if (optind == argc)
|
||||||
--- coreutils-6.11/src/expand.c
|
--- coreutils-6.12/src/expand.c
|
||||||
+++ coreutils-6.11/src/expand.c
|
+++ coreutils-6.12/src/expand.c
|
||||||
@@ -37,11 +37,31 @@
|
@@ -37,11 +37,31 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -837,8 +837,8 @@
|
|||||||
|
|
||||||
if (have_read_stdin && fclose (stdin) != 0)
|
if (have_read_stdin && fclose (stdin) != 0)
|
||||||
error (EXIT_FAILURE, errno, "-");
|
error (EXIT_FAILURE, errno, "-");
|
||||||
--- coreutils-6.11/src/fold.c
|
--- coreutils-6.12/src/fold.c
|
||||||
+++ coreutils-6.11/src/fold.c
|
+++ coreutils-6.12/src/fold.c
|
||||||
@@ -22,6 +22,19 @@
|
@@ -22,6 +22,19 @@
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -886,7 +886,7 @@
|
|||||||
/* The official name of this program (e.g., no `g' prefix). */
|
/* The official name of this program (e.g., no `g' prefix). */
|
||||||
#define PROGRAM_NAME "fold"
|
#define PROGRAM_NAME "fold"
|
||||||
|
|
||||||
#define AUTHORS "David MacKenzie"
|
#define AUTHORS proper_name ("David MacKenzie")
|
||||||
|
|
||||||
+#define FATAL_ERROR(Message) \
|
+#define FATAL_ERROR(Message) \
|
||||||
+ do \
|
+ do \
|
||||||
@ -1254,8 +1254,8 @@
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 's': /* Break at word boundaries. */
|
case 's': /* Break at word boundaries. */
|
||||||
--- coreutils-6.11/src/join.c
|
--- coreutils-6.12/src/join.c
|
||||||
+++ coreutils-6.11/src/join.c
|
+++ coreutils-6.12/src/join.c
|
||||||
@@ -22,6 +22,16 @@
|
@@ -22,6 +22,16 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -1694,8 +1694,8 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
--- coreutils-6.11/src/pr.c
|
--- coreutils-6.12/src/pr.c
|
||||||
+++ coreutils-6.11/src/pr.c
|
+++ coreutils-6.12/src/pr.c
|
||||||
@@ -312,6 +312,32 @@
|
@@ -312,6 +312,32 @@
|
||||||
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -1748,7 +1748,7 @@
|
|||||||
/* The official name of this program (e.g., no `g' prefix). */
|
/* The official name of this program (e.g., no `g' prefix). */
|
||||||
#define PROGRAM_NAME "pr"
|
#define PROGRAM_NAME "pr"
|
||||||
|
|
||||||
@@ -413,8 +451,21 @@ struct COLUMN
|
@@ -415,8 +453,21 @@ struct COLUMN
|
||||||
typedef struct COLUMN COLUMN;
|
typedef struct COLUMN COLUMN;
|
||||||
|
|
||||||
#define NULLCOL (COLUMN *)0
|
#define NULLCOL (COLUMN *)0
|
||||||
@ -1771,7 +1771,7 @@
|
|||||||
static bool read_line (COLUMN *p);
|
static bool read_line (COLUMN *p);
|
||||||
static bool print_page (void);
|
static bool print_page (void);
|
||||||
static bool print_stored (COLUMN *p);
|
static bool print_stored (COLUMN *p);
|
||||||
@@ -424,6 +475,7 @@ static void print_header (void);
|
@@ -426,6 +477,7 @@ static void print_header (void);
|
||||||
static void pad_across_to (int position);
|
static void pad_across_to (int position);
|
||||||
static void add_line_number (COLUMN *p);
|
static void add_line_number (COLUMN *p);
|
||||||
static void getoptarg (char *arg, char switch_char, char *character,
|
static void getoptarg (char *arg, char switch_char, char *character,
|
||||||
@ -1779,7 +1779,7 @@
|
|||||||
int *number);
|
int *number);
|
||||||
void usage (int status);
|
void usage (int status);
|
||||||
static void print_files (int number_of_files, char **av);
|
static void print_files (int number_of_files, char **av);
|
||||||
@@ -438,7 +490,6 @@ static void store_char (char c);
|
@@ -440,7 +492,6 @@ static void store_char (char c);
|
||||||
static void pad_down (int lines);
|
static void pad_down (int lines);
|
||||||
static void read_rest_of_line (COLUMN *p);
|
static void read_rest_of_line (COLUMN *p);
|
||||||
static void skip_read (COLUMN *p, int column_number);
|
static void skip_read (COLUMN *p, int column_number);
|
||||||
@ -1787,7 +1787,7 @@
|
|||||||
static void cleanup (void);
|
static void cleanup (void);
|
||||||
static void print_sep_string (void);
|
static void print_sep_string (void);
|
||||||
static void separator_string (const char *optarg_S);
|
static void separator_string (const char *optarg_S);
|
||||||
@@ -453,7 +504,7 @@ static COLUMN *column_vector;
|
@@ -455,7 +506,7 @@ static COLUMN *column_vector;
|
||||||
we store the leftmost columns contiguously in buff.
|
we store the leftmost columns contiguously in buff.
|
||||||
To print a line from buff, get the index of the first character
|
To print a line from buff, get the index of the first character
|
||||||
from line_vector[i], and print up to line_vector[i + 1]. */
|
from line_vector[i], and print up to line_vector[i + 1]. */
|
||||||
@ -1796,7 +1796,7 @@
|
|||||||
|
|
||||||
/* Index of the position in buff where the next character
|
/* Index of the position in buff where the next character
|
||||||
will be stored. */
|
will be stored. */
|
||||||
@@ -557,7 +608,7 @@ static int chars_per_column;
|
@@ -559,7 +610,7 @@ static int chars_per_column;
|
||||||
static bool untabify_input = false;
|
static bool untabify_input = false;
|
||||||
|
|
||||||
/* (-e) The input tab character. */
|
/* (-e) The input tab character. */
|
||||||
@ -1805,7 +1805,7 @@
|
|||||||
|
|
||||||
/* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
|
/* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
|
||||||
where the leftmost column is 1. */
|
where the leftmost column is 1. */
|
||||||
@@ -567,7 +618,10 @@ static int chars_per_input_tab = 8;
|
@@ -569,7 +620,10 @@ static int chars_per_input_tab = 8;
|
||||||
static bool tabify_output = false;
|
static bool tabify_output = false;
|
||||||
|
|
||||||
/* (-i) The output tab character. */
|
/* (-i) The output tab character. */
|
||||||
@ -1817,7 +1817,7 @@
|
|||||||
|
|
||||||
/* (-i) The width of the output tab. */
|
/* (-i) The width of the output tab. */
|
||||||
static int chars_per_output_tab = 8;
|
static int chars_per_output_tab = 8;
|
||||||
@@ -641,7 +695,13 @@ static int power_10;
|
@@ -643,7 +697,13 @@ static int power_10;
|
||||||
static bool numbered_lines = false;
|
static bool numbered_lines = false;
|
||||||
|
|
||||||
/* (-n) Character which follows each line number. */
|
/* (-n) Character which follows each line number. */
|
||||||
@ -1832,7 +1832,7 @@
|
|||||||
|
|
||||||
/* (-n) line counting starts with 1st line of input file (not with 1st
|
/* (-n) line counting starts with 1st line of input file (not with 1st
|
||||||
line of 1st page printed). */
|
line of 1st page printed). */
|
||||||
@@ -694,6 +754,7 @@ static bool use_col_separator = false;
|
@@ -696,6 +756,7 @@ static bool use_col_separator = false;
|
||||||
-a|COLUMN|-m is a `space' and with the -J option a `tab'. */
|
-a|COLUMN|-m is a `space' and with the -J option a `tab'. */
|
||||||
static char *col_sep_string = "";
|
static char *col_sep_string = "";
|
||||||
static int col_sep_length = 0;
|
static int col_sep_length = 0;
|
||||||
@ -1840,7 +1840,7 @@
|
|||||||
static char *column_separator = " ";
|
static char *column_separator = " ";
|
||||||
static char *line_separator = "\t";
|
static char *line_separator = "\t";
|
||||||
|
|
||||||
@@ -850,6 +911,13 @@ separator_string (const char *optarg_S)
|
@@ -852,6 +913,13 @@ separator_string (const char *optarg_S)
|
||||||
col_sep_length = (int) strlen (optarg_S);
|
col_sep_length = (int) strlen (optarg_S);
|
||||||
col_sep_string = xmalloc (col_sep_length + 1);
|
col_sep_string = xmalloc (col_sep_length + 1);
|
||||||
strcpy (col_sep_string, optarg_S);
|
strcpy (col_sep_string, optarg_S);
|
||||||
@ -1854,7 +1854,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -874,6 +942,21 @@ main (int argc, char **argv)
|
@@ -876,6 +944,21 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
atexit (close_stdout);
|
atexit (close_stdout);
|
||||||
|
|
||||||
@ -1876,7 +1876,7 @@
|
|||||||
n_files = 0;
|
n_files = 0;
|
||||||
file_names = (argc > 1
|
file_names = (argc > 1
|
||||||
? xmalloc ((argc - 1) * sizeof (char *))
|
? xmalloc ((argc - 1) * sizeof (char *))
|
||||||
@@ -950,8 +1033,12 @@ main (int argc, char **argv)
|
@@ -952,8 +1035,12 @@ main (int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
if (optarg)
|
if (optarg)
|
||||||
@ -1891,7 +1891,7 @@
|
|||||||
/* Could check tab width > 0. */
|
/* Could check tab width > 0. */
|
||||||
untabify_input = true;
|
untabify_input = true;
|
||||||
break;
|
break;
|
||||||
@@ -964,8 +1051,12 @@ main (int argc, char **argv)
|
@@ -966,8 +1053,12 @@ main (int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
if (optarg)
|
if (optarg)
|
||||||
@ -1906,7 +1906,7 @@
|
|||||||
/* Could check tab width > 0. */
|
/* Could check tab width > 0. */
|
||||||
tabify_output = true;
|
tabify_output = true;
|
||||||
break;
|
break;
|
||||||
@@ -992,8 +1083,8 @@ main (int argc, char **argv)
|
@@ -994,8 +1085,8 @@ main (int argc, char **argv)
|
||||||
case 'n':
|
case 'n':
|
||||||
numbered_lines = true;
|
numbered_lines = true;
|
||||||
if (optarg)
|
if (optarg)
|
||||||
@ -1917,7 +1917,7 @@
|
|||||||
break;
|
break;
|
||||||
case 'N':
|
case 'N':
|
||||||
skip_count = false;
|
skip_count = false;
|
||||||
@@ -1032,7 +1123,7 @@ main (int argc, char **argv)
|
@@ -1034,7 +1125,7 @@ main (int argc, char **argv)
|
||||||
old_s = false;
|
old_s = false;
|
||||||
/* Reset an additional input of -s, -S dominates -s */
|
/* Reset an additional input of -s, -S dominates -s */
|
||||||
col_sep_string = "";
|
col_sep_string = "";
|
||||||
@ -1926,7 +1926,7 @@
|
|||||||
use_col_separator = true;
|
use_col_separator = true;
|
||||||
if (optarg)
|
if (optarg)
|
||||||
separator_string (optarg);
|
separator_string (optarg);
|
||||||
@@ -1189,10 +1280,45 @@ main (int argc, char **argv)
|
@@ -1191,10 +1282,45 @@ main (int argc, char **argv)
|
||||||
a number. */
|
a number. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1974,7 +1974,7 @@
|
|||||||
if (*arg)
|
if (*arg)
|
||||||
{
|
{
|
||||||
long int tmp_long;
|
long int tmp_long;
|
||||||
@@ -1251,7 +1377,7 @@ init_parameters (int number_of_files)
|
@@ -1253,7 +1379,7 @@ init_parameters (int number_of_files)
|
||||||
else
|
else
|
||||||
col_sep_string = column_separator;
|
col_sep_string = column_separator;
|
||||||
|
|
||||||
@ -1983,7 +1983,7 @@
|
|||||||
use_col_separator = true;
|
use_col_separator = true;
|
||||||
}
|
}
|
||||||
/* It's rather pointless to define a TAB separator with column
|
/* It's rather pointless to define a TAB separator with column
|
||||||
@@ -1282,11 +1408,11 @@ init_parameters (int number_of_files)
|
@@ -1284,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. */
|
/* Estimate chars_per_text without any margin and keep it constant. */
|
||||||
@ -1997,7 +1997,7 @@
|
|||||||
|
|
||||||
/* The number is part of the column width unless we are
|
/* The number is part of the column width unless we are
|
||||||
printing files in parallel. */
|
printing files in parallel. */
|
||||||
@@ -1301,7 +1427,7 @@ init_parameters (int number_of_files)
|
@@ -1303,7 +1429,7 @@ init_parameters (int number_of_files)
|
||||||
}
|
}
|
||||||
|
|
||||||
chars_per_column = (chars_per_line - chars_used_by_number -
|
chars_per_column = (chars_per_line - chars_used_by_number -
|
||||||
@ -2006,7 +2006,7 @@
|
|||||||
|
|
||||||
if (chars_per_column < 1)
|
if (chars_per_column < 1)
|
||||||
error (EXIT_FAILURE, 0, _("page width too narrow"));
|
error (EXIT_FAILURE, 0, _("page width too narrow"));
|
||||||
@@ -1426,7 +1552,7 @@ init_funcs (void)
|
@@ -1428,7 +1554,7 @@ init_funcs (void)
|
||||||
|
|
||||||
/* Enlarge p->start_position of first column to use the same form of
|
/* Enlarge p->start_position of first column to use the same form of
|
||||||
padding_not_printed with all columns. */
|
padding_not_printed with all columns. */
|
||||||
@ -2015,7 +2015,7 @@
|
|||||||
|
|
||||||
/* This loop takes care of all but the rightmost column. */
|
/* This loop takes care of all but the rightmost column. */
|
||||||
|
|
||||||
@@ -1460,7 +1586,7 @@ init_funcs (void)
|
@@ -1462,7 +1588,7 @@ init_funcs (void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2024,7 +2024,7 @@
|
|||||||
h_next = h + chars_per_column;
|
h_next = h + chars_per_column;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1750,9 +1876,9 @@ static void
|
@@ -1752,9 +1878,9 @@ static void
|
||||||
align_column (COLUMN *p)
|
align_column (COLUMN *p)
|
||||||
{
|
{
|
||||||
padding_not_printed = p->start_position;
|
padding_not_printed = p->start_position;
|
||||||
@ -2036,7 +2036,7 @@
|
|||||||
padding_not_printed = ANYWHERE;
|
padding_not_printed = ANYWHERE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2023,13 +2149,13 @@ store_char (char c)
|
@@ -2025,13 +2151,13 @@ store_char (char c)
|
||||||
/* May be too generous. */
|
/* May be too generous. */
|
||||||
buff = X2REALLOC (buff, &buff_allocated);
|
buff = X2REALLOC (buff, &buff_allocated);
|
||||||
}
|
}
|
||||||
@ -2052,7 +2052,7 @@
|
|||||||
char *s;
|
char *s;
|
||||||
int left_cut;
|
int left_cut;
|
||||||
|
|
||||||
@@ -2052,22 +2178,24 @@ add_line_number (COLUMN *p)
|
@@ -2054,22 +2180,24 @@ add_line_number (COLUMN *p)
|
||||||
/* Tabification is assumed for multiple columns, also for n-separators,
|
/* Tabification is assumed for multiple columns, also for n-separators,
|
||||||
but `default n-separator = TAB' hasn't been given priority over
|
but `default n-separator = TAB' hasn't been given priority over
|
||||||
equal column_width also specified by POSIX. */
|
equal column_width also specified by POSIX. */
|
||||||
@ -2081,7 +2081,7 @@
|
|||||||
output_position = POS_AFTER_TAB (chars_per_output_tab,
|
output_position = POS_AFTER_TAB (chars_per_output_tab,
|
||||||
output_position);
|
output_position);
|
||||||
}
|
}
|
||||||
@@ -2228,7 +2356,7 @@ print_white_space (void)
|
@@ -2230,7 +2358,7 @@ print_white_space (void)
|
||||||
while (goal - h_old > 1
|
while (goal - h_old > 1
|
||||||
&& (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
|
&& (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
|
||||||
{
|
{
|
||||||
@ -2090,7 +2090,7 @@
|
|||||||
h_old = h_new;
|
h_old = h_new;
|
||||||
}
|
}
|
||||||
while (++h_old <= goal)
|
while (++h_old <= goal)
|
||||||
@@ -2248,6 +2376,7 @@ print_sep_string (void)
|
@@ -2250,6 +2378,7 @@ print_sep_string (void)
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
int l = col_sep_length;
|
int l = col_sep_length;
|
||||||
@ -2098,7 +2098,7 @@
|
|||||||
|
|
||||||
s = col_sep_string;
|
s = col_sep_string;
|
||||||
|
|
||||||
@@ -2261,6 +2390,7 @@ print_sep_string (void)
|
@@ -2263,6 +2392,7 @@ print_sep_string (void)
|
||||||
{
|
{
|
||||||
for (; separators_not_printed > 0; --separators_not_printed)
|
for (; separators_not_printed > 0; --separators_not_printed)
|
||||||
{
|
{
|
||||||
@ -2106,7 +2106,7 @@
|
|||||||
while (l-- > 0)
|
while (l-- > 0)
|
||||||
{
|
{
|
||||||
/* 3 types of sep_strings: spaces only, spaces and chars,
|
/* 3 types of sep_strings: spaces only, spaces and chars,
|
||||||
@@ -2274,12 +2404,15 @@ print_sep_string (void)
|
@@ -2276,12 +2406,15 @@ print_sep_string (void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2123,7 +2123,7 @@
|
|||||||
/* sep_string ends with some spaces */
|
/* sep_string ends with some spaces */
|
||||||
if (spaces_not_printed > 0)
|
if (spaces_not_printed > 0)
|
||||||
print_white_space ();
|
print_white_space ();
|
||||||
@@ -2306,8 +2439,9 @@ print_clump (COLUMN *p, int n, char *clu
|
@@ -2308,8 +2441,9 @@ print_clump (COLUMN *p, int n, char *clu
|
||||||
a nonspace is encountered, call print_white_space() to print the
|
a nonspace is encountered, call print_white_space() to print the
|
||||||
required number of tabs and spaces. */
|
required number of tabs and spaces. */
|
||||||
|
|
||||||
@ -2134,7 +2134,7 @@
|
|||||||
{
|
{
|
||||||
if (tabify_output)
|
if (tabify_output)
|
||||||
{
|
{
|
||||||
@@ -2331,6 +2465,75 @@ print_char (char c)
|
@@ -2333,6 +2467,75 @@ print_char (char c)
|
||||||
putchar (c);
|
putchar (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2210,7 +2210,7 @@
|
|||||||
/* Skip to page PAGE before printing.
|
/* Skip to page PAGE before printing.
|
||||||
PAGE may be larger than total number of pages. */
|
PAGE may be larger than total number of pages. */
|
||||||
|
|
||||||
@@ -2508,9 +2711,9 @@ read_line (COLUMN *p)
|
@@ -2510,9 +2713,9 @@ read_line (COLUMN *p)
|
||||||
align_empty_cols = false;
|
align_empty_cols = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2222,7 +2222,7 @@
|
|||||||
padding_not_printed = ANYWHERE;
|
padding_not_printed = ANYWHERE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2611,9 +2814,9 @@ print_stored (COLUMN *p)
|
@@ -2613,9 +2816,9 @@ print_stored (COLUMN *p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2234,7 +2234,7 @@
|
|||||||
padding_not_printed = ANYWHERE;
|
padding_not_printed = ANYWHERE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2626,8 +2829,8 @@ print_stored (COLUMN *p)
|
@@ -2628,8 +2831,8 @@ print_stored (COLUMN *p)
|
||||||
if (spaces_not_printed == 0)
|
if (spaces_not_printed == 0)
|
||||||
{
|
{
|
||||||
output_position = p->start_position + end_vector[line];
|
output_position = p->start_position + end_vector[line];
|
||||||
@ -2245,7 +2245,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -2645,8 +2848,9 @@ print_stored (COLUMN *p)
|
@@ -2647,8 +2850,9 @@ print_stored (COLUMN *p)
|
||||||
characters in clump_buff. (e.g, the width of '\b' is -1, while the
|
characters in clump_buff. (e.g, the width of '\b' is -1, while the
|
||||||
number of characters is 1.) */
|
number of characters is 1.) */
|
||||||
|
|
||||||
@ -2256,7 +2256,7 @@
|
|||||||
{
|
{
|
||||||
unsigned char uc = c;
|
unsigned char uc = c;
|
||||||
char *s = clump_buff;
|
char *s = clump_buff;
|
||||||
@@ -2656,10 +2860,10 @@ char_to_clump (char c)
|
@@ -2658,10 +2862,10 @@ char_to_clump (char c)
|
||||||
int chars;
|
int chars;
|
||||||
int chars_per_c = 8;
|
int chars_per_c = 8;
|
||||||
|
|
||||||
@ -2269,7 +2269,7 @@
|
|||||||
{
|
{
|
||||||
width = TAB_WIDTH (chars_per_c, input_position);
|
width = TAB_WIDTH (chars_per_c, input_position);
|
||||||
|
|
||||||
@@ -2740,6 +2944,155 @@ char_to_clump (char c)
|
@@ -2742,6 +2946,155 @@ char_to_clump (char c)
|
||||||
return chars;
|
return chars;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2425,8 +2425,8 @@
|
|||||||
/* We've just printed some files and need to clean up things before
|
/* We've just printed some files and need to clean up things before
|
||||||
looking for more options and printing the next batch of files.
|
looking for more options and printing the next batch of files.
|
||||||
|
|
||||||
--- coreutils-6.11/src/sort.c
|
--- coreutils-6.12/src/sort.c
|
||||||
+++ coreutils-6.11/src/sort.c
|
+++ coreutils-6.12/src/sort.c
|
||||||
@@ -26,6 +26,19 @@
|
@@ -26,6 +26,19 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
@ -2465,7 +2465,7 @@
|
|||||||
/* The official name of this program (e.g., no `g' prefix). */
|
/* The official name of this program (e.g., no `g' prefix). */
|
||||||
#define PROGRAM_NAME "sort"
|
#define PROGRAM_NAME "sort"
|
||||||
|
|
||||||
@@ -115,14 +139,38 @@ static int decimal_point;
|
@@ -117,14 +141,38 @@ static int decimal_point;
|
||||||
/* Thousands separator; if -1, then there isn't one. */
|
/* Thousands separator; if -1, then there isn't one. */
|
||||||
static int thousands_sep;
|
static int thousands_sep;
|
||||||
|
|
||||||
@ -2505,7 +2505,7 @@
|
|||||||
/* The kind of blanks for '-b' to skip in various options. */
|
/* The kind of blanks for '-b' to skip in various options. */
|
||||||
enum blanktype { bl_start, bl_end, bl_both };
|
enum blanktype { bl_start, bl_end, bl_both };
|
||||||
|
|
||||||
@@ -260,13 +308,11 @@ static bool reverse;
|
@@ -262,13 +310,11 @@ static bool reverse;
|
||||||
they were read if all keys compare equal. */
|
they were read if all keys compare equal. */
|
||||||
static bool stable;
|
static bool stable;
|
||||||
|
|
||||||
@ -2523,7 +2523,7 @@
|
|||||||
|
|
||||||
/* Flag to remove consecutive duplicate lines from the output.
|
/* Flag to remove consecutive duplicate lines from the output.
|
||||||
Only the last of a sequence of equal lines will be output. */
|
Only the last of a sequence of equal lines will be output. */
|
||||||
@@ -653,6 +699,43 @@ reap_some (void)
|
@@ -655,6 +701,43 @@ reap_some (void)
|
||||||
update_proc (pid);
|
update_proc (pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2567,7 +2567,7 @@
|
|||||||
/* Clean up any remaining temporary files. */
|
/* Clean up any remaining temporary files. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -992,7 +1075,7 @@ zaptemp (const char *name)
|
@@ -994,7 +1077,7 @@ zaptemp (const char *name)
|
||||||
free (node);
|
free (node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2576,7 +2576,7 @@
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
struct_month_cmp (const void *m1, const void *m2)
|
struct_month_cmp (const void *m1, const void *m2)
|
||||||
@@ -1019,7 +1102,7 @@ inittables (void)
|
@@ -1021,7 +1104,7 @@ inittables (void)
|
||||||
fold_toupper[i] = toupper (i);
|
fold_toupper[i] = toupper (i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2585,7 +2585,7 @@
|
|||||||
/* If we're not in the "C" locale, read different names for months. */
|
/* If we're not in the "C" locale, read different names for months. */
|
||||||
if (hard_LC_TIME)
|
if (hard_LC_TIME)
|
||||||
{
|
{
|
||||||
@@ -1045,6 +1128,71 @@ inittables (void)
|
@@ -1047,6 +1130,71 @@ inittables (void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2657,7 +2657,7 @@
|
|||||||
/* Specify the amount of main memory to use when sorting. */
|
/* Specify the amount of main memory to use when sorting. */
|
||||||
static void
|
static void
|
||||||
specify_sort_size (int oi, char c, char const *s)
|
specify_sort_size (int oi, char c, char const *s)
|
||||||
@@ -1255,7 +1403,7 @@ buffer_linelim (struct buffer const *buf
|
@@ -1257,7 +1405,7 @@ buffer_linelim (struct buffer const *buf
|
||||||
by KEY in LINE. */
|
by KEY in LINE. */
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
@ -2666,7 +2666,7 @@
|
|||||||
{
|
{
|
||||||
char *ptr = line->text, *lim = ptr + line->length - 1;
|
char *ptr = line->text, *lim = ptr + line->length - 1;
|
||||||
size_t sword = key->sword;
|
size_t sword = key->sword;
|
||||||
@@ -1265,10 +1413,10 @@ begfield (const struct line *line, const
|
@@ -1267,10 +1415,10 @@ begfield (const struct line *line, const
|
||||||
/* The leading field separator itself is included in a field when -t
|
/* The leading field separator itself is included in a field when -t
|
||||||
is absent. */
|
is absent. */
|
||||||
|
|
||||||
@ -2679,7 +2679,7 @@
|
|||||||
++ptr;
|
++ptr;
|
||||||
if (ptr < lim)
|
if (ptr < lim)
|
||||||
++ptr;
|
++ptr;
|
||||||
@@ -1296,11 +1444,70 @@ begfield (const struct line *line, const
|
@@ -1298,11 +1446,70 @@ begfield (const struct line *line, const
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2751,7 +2751,7 @@
|
|||||||
{
|
{
|
||||||
char *ptr = line->text, *lim = ptr + line->length - 1;
|
char *ptr = line->text, *lim = ptr + line->length - 1;
|
||||||
size_t eword = key->eword, echar = key->echar;
|
size_t eword = key->eword, echar = key->echar;
|
||||||
@@ -1313,10 +1520,10 @@ limfield (const struct line *line, const
|
@@ -1315,10 +1522,10 @@ limfield (const struct line *line, const
|
||||||
`beginning' is the first character following the delimiting TAB.
|
`beginning' is the first character following the delimiting TAB.
|
||||||
Otherwise, leave PTR pointing at the first `blank' character after
|
Otherwise, leave PTR pointing at the first `blank' character after
|
||||||
the preceding field. */
|
the preceding field. */
|
||||||
@ -2764,7 +2764,7 @@
|
|||||||
++ptr;
|
++ptr;
|
||||||
if (ptr < lim && (eword | echar))
|
if (ptr < lim && (eword | echar))
|
||||||
++ptr;
|
++ptr;
|
||||||
@@ -1362,7 +1569,7 @@ limfield (const struct line *line, const
|
@@ -1364,7 +1571,7 @@ limfield (const struct line *line, const
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Make LIM point to the end of (one byte past) the current field. */
|
/* Make LIM point to the end of (one byte past) the current field. */
|
||||||
@ -2773,7 +2773,7 @@
|
|||||||
{
|
{
|
||||||
char *newlim;
|
char *newlim;
|
||||||
newlim = memchr (ptr, tab, lim - ptr);
|
newlim = memchr (ptr, tab, lim - ptr);
|
||||||
@@ -1398,6 +1605,107 @@ limfield (const struct line *line, const
|
@@ -1400,6 +1607,107 @@ limfield (const struct line *line, const
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2881,7 +2881,7 @@
|
|||||||
/* Fill BUF reading from FP, moving buf->left bytes from the end
|
/* Fill BUF reading from FP, moving buf->left bytes from the end
|
||||||
of buf->buf to the beginning first. If EOF is reached and the
|
of buf->buf to the beginning first. If EOF is reached and the
|
||||||
file wasn't terminated by a newline, supply one. Set up BUF's line
|
file wasn't terminated by a newline, supply one. Set up BUF's line
|
||||||
@@ -1480,8 +1788,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
|
@@ -1482,8 +1790,22 @@ fillbuf (struct buffer *buf, FILE *fp, c
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (key->skipsblanks)
|
if (key->skipsblanks)
|
||||||
@ -2906,7 +2906,7 @@
|
|||||||
line->keybeg = line_start;
|
line->keybeg = line_start;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1536,15 +1858,59 @@ general_numcompare (const char *sa, cons
|
@@ -1538,15 +1860,59 @@ general_numcompare (const char *sa, cons
|
||||||
/* FIXME: maybe add option to try expensive FP conversion
|
/* FIXME: maybe add option to try expensive FP conversion
|
||||||
only if A and B can't be compared more cheaply/accurately. */
|
only if A and B can't be compared more cheaply/accurately. */
|
||||||
|
|
||||||
@ -2973,7 +2973,7 @@
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Sort numbers in the usual way, where -0 == +0. Put NaNs after
|
/* Sort numbers in the usual way, where -0 == +0. Put NaNs after
|
||||||
@@ -1562,7 +1928,7 @@ general_numcompare (const char *sa, cons
|
@@ -1564,7 +1930,7 @@ general_numcompare (const char *sa, cons
|
||||||
Return 0 if the name in S is not recognized. */
|
Return 0 if the name in S is not recognized. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -2982,7 +2982,7 @@
|
|||||||
{
|
{
|
||||||
size_t lo = 0;
|
size_t lo = 0;
|
||||||
size_t hi = MONTHS_PER_YEAR;
|
size_t hi = MONTHS_PER_YEAR;
|
||||||
@@ -1717,11 +2083,79 @@ compare_random (char *restrict texta, si
|
@@ -1719,11 +2085,79 @@ compare_random (char *restrict texta, si
|
||||||
return diff;
|
return diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3063,7 +3063,7 @@
|
|||||||
{
|
{
|
||||||
struct keyfield const *key = keylist;
|
struct keyfield const *key = keylist;
|
||||||
|
|
||||||
@@ -1888,12 +2322,189 @@ keycompare (const struct line *a, const
|
@@ -1890,12 +2324,189 @@ keycompare (const struct line *a, const
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -3255,7 +3255,7 @@
|
|||||||
/* Compare two lines A and B, returning negative, zero, or positive
|
/* Compare two lines A and B, returning negative, zero, or positive
|
||||||
depending on whether A compares less than, equal to, or greater than B. */
|
depending on whether A compares less than, equal to, or greater than B. */
|
||||||
|
|
||||||
@@ -2710,6 +3321,11 @@ set_ordering (const char *s, struct keyf
|
@@ -2712,6 +3323,11 @@ set_ordering (const char *s, struct keyf
|
||||||
break;
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
key->month = true;
|
key->month = true;
|
||||||
@ -3267,7 +3267,7 @@
|
|||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
key->numeric = true;
|
key->numeric = true;
|
||||||
@@ -2763,7 +3379,7 @@ main (int argc, char **argv)
|
@@ -2765,7 +3381,7 @@ main (int argc, char **argv)
|
||||||
initialize_exit_failure (SORT_FAILURE);
|
initialize_exit_failure (SORT_FAILURE);
|
||||||
|
|
||||||
hard_LC_COLLATE = hard_locale (LC_COLLATE);
|
hard_LC_COLLATE = hard_locale (LC_COLLATE);
|
||||||
@ -3276,7 +3276,7 @@
|
|||||||
hard_LC_TIME = hard_locale (LC_TIME);
|
hard_LC_TIME = hard_locale (LC_TIME);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2776,14 +3392,40 @@ main (int argc, char **argv)
|
@@ -2778,14 +3394,40 @@ main (int argc, char **argv)
|
||||||
add support for multibyte decimal points. */
|
add support for multibyte decimal points. */
|
||||||
decimal_point = to_uchar (locale->decimal_point[0]);
|
decimal_point = to_uchar (locale->decimal_point[0]);
|
||||||
if (! decimal_point || locale->decimal_point[1])
|
if (! decimal_point || locale->decimal_point[1])
|
||||||
@ -3319,7 +3319,7 @@
|
|||||||
have_read_stdin = false;
|
have_read_stdin = false;
|
||||||
inittables ();
|
inittables ();
|
||||||
|
|
||||||
@@ -3035,13 +3677,32 @@ main (int argc, char **argv)
|
@@ -3037,13 +3679,32 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
{
|
{
|
||||||
@ -3356,7 +3356,7 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Provoke with `sort -txx'. Complain about
|
/* Provoke with `sort -txx'. Complain about
|
||||||
@@ -3052,9 +3713,12 @@ main (int argc, char **argv)
|
@@ -3054,9 +3715,12 @@ main (int argc, char **argv)
|
||||||
quote (optarg));
|
quote (optarg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3370,8 +3370,8 @@
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
--- coreutils-6.11/src/unexpand.c
|
--- coreutils-6.12/src/unexpand.c
|
||||||
+++ coreutils-6.11/src/unexpand.c
|
+++ coreutils-6.12/src/unexpand.c
|
||||||
@@ -38,11 +38,34 @@
|
@@ -38,11 +38,34 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@ -3659,8 +3659,8 @@
|
|||||||
|
|
||||||
if (have_read_stdin && fclose (stdin) != 0)
|
if (have_read_stdin && fclose (stdin) != 0)
|
||||||
error (EXIT_FAILURE, errno, "-");
|
error (EXIT_FAILURE, errno, "-");
|
||||||
--- coreutils-6.11/src/uniq.c
|
--- coreutils-6.12/src/uniq.c
|
||||||
+++ coreutils-6.11/src/uniq.c
|
+++ coreutils-6.12/src/uniq.c
|
||||||
@@ -22,6 +22,16 @@
|
@@ -22,6 +22,16 @@
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -3692,7 +3692,7 @@
|
|||||||
/* The official name of this program (e.g., no `g' prefix). */
|
/* The official name of this program (e.g., no `g' prefix). */
|
||||||
#define PROGRAM_NAME "uniq"
|
#define PROGRAM_NAME "uniq"
|
||||||
|
|
||||||
@@ -108,6 +125,12 @@ static enum delimit_method const delimit
|
@@ -110,6 +127,12 @@ static enum delimit_method const delimit
|
||||||
/* Select whether/how to delimit groups of duplicate lines. */
|
/* Select whether/how to delimit groups of duplicate lines. */
|
||||||
static enum delimit_method delimit_groups;
|
static enum delimit_method delimit_groups;
|
||||||
|
|
||||||
@ -3705,7 +3705,7 @@
|
|||||||
static struct option const longopts[] =
|
static struct option const longopts[] =
|
||||||
{
|
{
|
||||||
{"count", no_argument, NULL, 'c'},
|
{"count", no_argument, NULL, 'c'},
|
||||||
@@ -204,7 +227,7 @@ size_opt (char const *opt, char const *m
|
@@ -206,7 +229,7 @@ size_opt (char const *opt, char const *m
|
||||||
return a pointer to the beginning of the line's field to be compared. */
|
return a pointer to the beginning of the line's field to be compared. */
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
@ -3714,7 +3714,7 @@
|
|||||||
{
|
{
|
||||||
size_t count;
|
size_t count;
|
||||||
char *lp = line->buffer;
|
char *lp = line->buffer;
|
||||||
@@ -225,6 +248,83 @@ find_field (const struct linebuffer *lin
|
@@ -227,6 +250,83 @@ find_field (const struct linebuffer *lin
|
||||||
return lp + i;
|
return lp + i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3798,7 +3798,7 @@
|
|||||||
/* Return false if two strings OLD and NEW match, true if not.
|
/* Return false if two strings OLD and NEW match, true if not.
|
||||||
OLD and NEW point not to the beginnings of the lines
|
OLD and NEW point not to the beginnings of the lines
|
||||||
but rather to the beginnings of the fields to compare.
|
but rather to the beginnings of the fields to compare.
|
||||||
@@ -249,6 +349,73 @@ different (char *old, char *new, size_t
|
@@ -251,6 +351,73 @@ different (char *old, char *new, size_t
|
||||||
return oldlen != newlen || memcmp (old, new, oldlen);
|
return oldlen != newlen || memcmp (old, new, oldlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3872,7 +3872,7 @@
|
|||||||
/* Output the line in linebuffer LINE to standard output
|
/* Output the line in linebuffer LINE to standard output
|
||||||
provided that the switches say it should be output.
|
provided that the switches say it should be output.
|
||||||
MATCH is true if the line matches the previous line.
|
MATCH is true if the line matches the previous line.
|
||||||
@@ -301,15 +468,42 @@ check_file (const char *infile, const ch
|
@@ -303,15 +470,42 @@ check_file (const char *infile, const ch
|
||||||
{
|
{
|
||||||
char *prevfield IF_LINT (= NULL);
|
char *prevfield IF_LINT (= NULL);
|
||||||
size_t prevlen IF_LINT (= 0);
|
size_t prevlen IF_LINT (= 0);
|
||||||
@ -3915,7 +3915,7 @@
|
|||||||
if (prevline->length == 0
|
if (prevline->length == 0
|
||||||
|| different (thisfield, prevfield, thislen, prevlen))
|
|| different (thisfield, prevfield, thislen, prevlen))
|
||||||
{
|
{
|
||||||
@@ -328,17 +522,26 @@ check_file (const char *infile, const ch
|
@@ -330,17 +524,26 @@ check_file (const char *infile, const ch
|
||||||
size_t prevlen;
|
size_t prevlen;
|
||||||
uintmax_t match_count = 0;
|
uintmax_t match_count = 0;
|
||||||
bool first_delimiter = true;
|
bool first_delimiter = true;
|
||||||
@ -3942,7 +3942,7 @@
|
|||||||
if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
|
if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
|
||||||
{
|
{
|
||||||
if (ferror (stdin))
|
if (ferror (stdin))
|
||||||
@@ -347,6 +550,15 @@ check_file (const char *infile, const ch
|
@@ -349,6 +552,15 @@ check_file (const char *infile, const ch
|
||||||
}
|
}
|
||||||
thisfield = find_field (thisline);
|
thisfield = find_field (thisline);
|
||||||
thislen = thisline->length - 1 - (thisfield - thisline->buffer);
|
thislen = thisline->length - 1 - (thisfield - thisline->buffer);
|
||||||
@ -3958,7 +3958,7 @@
|
|||||||
match = !different (thisfield, prevfield, thislen, prevlen);
|
match = !different (thisfield, prevfield, thislen, prevlen);
|
||||||
match_count += match;
|
match_count += match;
|
||||||
|
|
||||||
@@ -379,6 +591,9 @@ check_file (const char *infile, const ch
|
@@ -381,6 +593,9 @@ check_file (const char *infile, const ch
|
||||||
SWAP_LINES (prevline, thisline);
|
SWAP_LINES (prevline, thisline);
|
||||||
prevfield = thisfield;
|
prevfield = thisfield;
|
||||||
prevlen = thislen;
|
prevlen = thislen;
|
||||||
@ -3968,7 +3968,7 @@
|
|||||||
if (!match)
|
if (!match)
|
||||||
match_count = 0;
|
match_count = 0;
|
||||||
}
|
}
|
||||||
@@ -424,6 +639,18 @@ main (int argc, char **argv)
|
@@ -426,6 +641,18 @@ main (int argc, char **argv)
|
||||||
|
|
||||||
atexit (close_stdout);
|
atexit (close_stdout);
|
||||||
|
|
||||||
@ -3987,3 +3987,14 @@
|
|||||||
skip_chars = 0;
|
skip_chars = 0;
|
||||||
skip_fields = 0;
|
skip_fields = 0;
|
||||||
check_chars = SIZE_MAX;
|
check_chars = SIZE_MAX;
|
||||||
|
--- coreutils-6.12/tests/misc/cut
|
||||||
|
+++ coreutils-6.12/tests/misc/cut
|
||||||
|
@@ -26,7 +26,7 @@ use strict;
|
||||||
|
my $prog = 'cut';
|
||||||
|
my $try = "Try \`$prog --help' for more information.\n";
|
||||||
|
my $from_1 = "$prog: fields and positions are numbered from 1\n$try";
|
||||||
|
-my $inval = "$prog: invalid byte or field list\n$try";
|
||||||
|
+my $inval = "$prog: invalid byte, character or field list\n$try";
|
||||||
|
my $no_endpoint = "$prog: invalid range with no endpoint: -\n$try";
|
||||||
|
|
||||||
|
my @Tests =
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:eb9976291aad92dd586c9ac41669024de065772cc2f2608200d50643ea3a8bce
|
|
||||||
size 9095150
|
|
@ -1,6 +1,6 @@
|
|||||||
--- doc/coreutils.texi
|
--- doc/coreutils.texi
|
||||||
+++ doc/coreutils.texi
|
+++ doc/coreutils.texi
|
||||||
@@ -65,8 +65,6 @@
|
@@ -67,8 +67,6 @@
|
||||||
* fold: (coreutils)fold invocation. Wrap long input lines.
|
* fold: (coreutils)fold invocation. Wrap long input lines.
|
||||||
* groups: (coreutils)groups invocation. Print group names a user is in.
|
* groups: (coreutils)groups invocation. Print group names a user is in.
|
||||||
* head: (coreutils)head invocation. Output the first part of files.
|
* head: (coreutils)head invocation. Output the first part of files.
|
||||||
@ -9,7 +9,7 @@
|
|||||||
* id: (coreutils)id invocation. Print user identity.
|
* id: (coreutils)id invocation. Print user identity.
|
||||||
* install: (coreutils)install invocation. Copy and change attributes.
|
* install: (coreutils)install invocation. Copy and change attributes.
|
||||||
* join: (coreutils)join invocation. Join lines on a common field.
|
* join: (coreutils)join invocation. Join lines on a common field.
|
||||||
@@ -400,8 +398,6 @@ System context
|
@@ -402,8 +400,6 @@ System context
|
||||||
* arch invocation:: Print machine hardware name
|
* arch invocation:: Print machine hardware name
|
||||||
* date invocation:: Print or set system date and time
|
* date invocation:: Print or set system date and time
|
||||||
* uname invocation:: Print system information
|
* uname invocation:: Print system information
|
||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
@command{date}: Print or set system date and time
|
@command{date}: Print or set system date and time
|
||||||
|
|
||||||
@@ -12515,8 +12511,6 @@ information.
|
@@ -12523,8 +12519,6 @@ information.
|
||||||
* arch invocation:: Print machine hardware name.
|
* arch invocation:: Print machine hardware name.
|
||||||
* date invocation:: Print or set system date and time.
|
* date invocation:: Print or set system date and time.
|
||||||
* uname invocation:: Print system information.
|
* uname invocation:: Print system information.
|
||||||
@ -27,7 +27,7 @@
|
|||||||
@end menu
|
@end menu
|
||||||
|
|
||||||
|
|
||||||
@@ -13296,55 +13290,6 @@ Print the kernel version.
|
@@ -13304,55 +13298,6 @@ Print the kernel version.
|
||||||
|
|
||||||
@exitstatus
|
@exitstatus
|
||||||
|
|
||||||
@ -112,14 +112,14 @@
|
|||||||
}
|
}
|
||||||
--- m4/gnulib-comp.m4
|
--- m4/gnulib-comp.m4
|
||||||
+++ m4/gnulib-comp.m4
|
+++ m4/gnulib-comp.m4
|
||||||
@@ -248,7 +248,6 @@ AC_DEFUN([gl_INIT],
|
@@ -260,7 +260,6 @@ AC_DEFUN([gl_INIT],
|
||||||
gl_POSIXVER
|
gl_POSIXVER
|
||||||
gl_FUNC_PRINTF_FREXP
|
gl_FUNC_PRINTF_FREXP
|
||||||
gl_FUNC_PRINTF_FREXPL
|
gl_FUNC_PRINTF_FREXPL
|
||||||
- m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
|
- m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
|
||||||
gl_FUNC_PUTENV
|
m4_ifdef([AM_XGETTEXT_OPTION],
|
||||||
gl_STDLIB_MODULE_INDICATOR([putenv])
|
[AM_XGETTEXT_OPTION([--keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'])
|
||||||
gl_QUOTE
|
AM_XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'])])
|
||||||
--- man/Makefile.am
|
--- man/Makefile.am
|
||||||
+++ man/Makefile.am
|
+++ man/Makefile.am
|
||||||
@@ -179,7 +179,7 @@ check-x-vs-1:
|
@@ -179,7 +179,7 @@ check-x-vs-1:
|
||||||
@ -144,7 +144,7 @@
|
|||||||
/* Extract or fake data from a `struct stat'.
|
/* Extract or fake data from a `struct stat'.
|
||||||
--- tests/misc/help-version
|
--- tests/misc/help-version
|
||||||
+++ tests/misc/help-version
|
+++ tests/misc/help-version
|
||||||
@@ -180,6 +180,7 @@ lbracket_args=": ]"
|
@@ -178,6 +178,7 @@ lbracket_args=": ]"
|
||||||
for i in $built_programs; do
|
for i in $built_programs; do
|
||||||
# Skip these.
|
# Skip these.
|
||||||
case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac
|
case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac
|
3
coreutils-6.12.tar.gz
Normal file
3
coreutils-6.12.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:49d2f703e2310e6328cb6f9d9bae3612c42b3ee5175f449692c5b95e453cf18a
|
||||||
|
size 9001890
|
@ -1,3 +1,27 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jun 4 14:10:05 CEST 2008 - schwab@suse.de
|
||||||
|
|
||||||
|
- Update to coreutils 6.12.
|
||||||
|
** Bug fixes
|
||||||
|
chcon, runcon: --help output now includes the bug-reporting address
|
||||||
|
cp -p copies permissions more portably. For example, on MacOS X 10.5,
|
||||||
|
"cp -p some-fifo some-file" no longer fails while trying to copy the
|
||||||
|
permissions from the some-fifo argument.
|
||||||
|
id with no options now prints the SELinux context only when invoked
|
||||||
|
with no USERNAME argument.
|
||||||
|
id and groups once again print the AFS-specific nameless group-ID (PAG).
|
||||||
|
Printing of such large-numbered, kernel-only (not in /etc/group) group-IDs
|
||||||
|
was suppressed in 6.11 due to ignorance that they are useful.
|
||||||
|
uniq: avoid subtle field-skipping malfunction due to isblank misuse.
|
||||||
|
In some locales on some systems, isblank(240) (aka  ) is nonzero.
|
||||||
|
On such systems, uniq --skip-fields=N would fail to skip the proper
|
||||||
|
number of fields for some inputs.
|
||||||
|
tac: avoid segfault with --regex (-r) and multiple files, e.g.,
|
||||||
|
"echo > x; tac -r x x". [bug present at least in textutils-1.8b, from 1992]
|
||||||
|
** Changes in behavior
|
||||||
|
install once again sets SELinux context, when possible
|
||||||
|
[it was deliberately disabled in 6.9.90]
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Apr 20 00:19:07 CEST 2008 - schwab@suse.de
|
Sun Apr 20 00:19:07 CEST 2008 - schwab@suse.de
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# spec file for package coreutils (Version 6.11)
|
# spec file for package coreutils (Version 6.12)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
# This file and all modifications and additions to the pristine
|
||||||
@ -16,7 +16,7 @@ BuildRequires: help2man libacl-devel pam-devel
|
|||||||
Url: http://www.gnu.org/software/coreutils/
|
Url: http://www.gnu.org/software/coreutils/
|
||||||
License: GNU Free Documentation License, Version 1.2 (GFDL 1.2); GPL v2 or later; GPL v3 or later
|
License: GNU Free Documentation License, Version 1.2 (GFDL 1.2); GPL v2 or later; GPL v3 or later
|
||||||
Group: System/Base
|
Group: System/Base
|
||||||
Version: 6.11
|
Version: 6.12
|
||||||
Release: 1
|
Release: 1
|
||||||
Provides: fileutils sh-utils stat textutils mktemp
|
Provides: fileutils sh-utils stat textutils mktemp
|
||||||
Obsoletes: fileutils sh-utils stat textutils mktemp
|
Obsoletes: fileutils sh-utils stat textutils mktemp
|
||||||
@ -41,6 +41,7 @@ Patch20: coreutils-6.8-su.diff
|
|||||||
Patch21: coreutils-6.8.0-pie.diff
|
Patch21: coreutils-6.8.0-pie.diff
|
||||||
Patch22: coreutils-5.3.0-sbin4su.diff
|
Patch22: coreutils-5.3.0-sbin4su.diff
|
||||||
Patch23: coreutils-getaddrinfo.diff
|
Patch23: coreutils-getaddrinfo.diff
|
||||||
|
Patch24: utimens.diff
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -110,6 +111,7 @@ Authors:
|
|||||||
%patch21
|
%patch21
|
||||||
%patch22
|
%patch22
|
||||||
%patch23 -p1
|
%patch23 -p1
|
||||||
|
%patch24 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
AUTOPOINT=true autoreconf -fi
|
AUTOPOINT=true autoreconf -fi
|
||||||
@ -178,6 +180,27 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jun 04 2008 schwab@suse.de
|
||||||
|
- Update to coreutils 6.12.
|
||||||
|
** Bug fixes
|
||||||
|
chcon, runcon: --help output now includes the bug-reporting address
|
||||||
|
cp -p copies permissions more portably. For example, on MacOS X 10.5,
|
||||||
|
"cp -p some-fifo some-file" no longer fails while trying to copy the
|
||||||
|
permissions from the some-fifo argument.
|
||||||
|
id with no options now prints the SELinux context only when invoked
|
||||||
|
with no USERNAME argument.
|
||||||
|
id and groups once again print the AFS-specific nameless group-ID (PAG).
|
||||||
|
Printing of such large-numbered, kernel-only (not in /etc/group) group-IDs
|
||||||
|
was suppressed in 6.11 due to ignorance that they are useful.
|
||||||
|
uniq: avoid subtle field-skipping malfunction due to isblank misuse.
|
||||||
|
In some locales on some systems, isblank(240) (aka  ) is nonzero.
|
||||||
|
On such systems, uniq --skip-fields=N would fail to skip the proper
|
||||||
|
number of fields for some inputs.
|
||||||
|
tac: avoid segfault with --regex (-r) and multiple files, e.g.,
|
||||||
|
"echo > x; tac -r x x". [bug present at least in textutils-1.8b, from 1992]
|
||||||
|
** Changes in behavior
|
||||||
|
install once again sets SELinux context, when possible
|
||||||
|
[it was deliberately disabled in 6.9.90]
|
||||||
* Sun Apr 20 2008 schwab@suse.de
|
* Sun Apr 20 2008 schwab@suse.de
|
||||||
- Update to coreutils 6.11.
|
- Update to coreutils 6.11.
|
||||||
** Bug fixes
|
** Bug fixes
|
||||||
|
112
utimens.diff
Normal file
112
utimens.diff
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
2008-06-02 Eric Blake <ebb9@byu.net>
|
||||||
|
|
||||||
|
Provide fallback for older kernels.
|
||||||
|
* lib/utimens.c (gl_futimens) [HAVE_UTIMENSAT, HAVE_FUTIMENS]:
|
||||||
|
Provide runtime fallback if kernel lacks support.
|
||||||
|
Reported by Mike Frysinger.
|
||||||
|
|
||||||
|
diff --git a/lib/utimens.c b/lib/utimens.c
|
||||||
|
index 25bc965..134310b 100644
|
||||||
|
--- a/lib/utimens.c
|
||||||
|
+++ b/lib/utimens.c
|
||||||
|
@@ -96,20 +96,30 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* POSIX 200x added two interfaces to set file timestamps with
|
||||||
|
- nanosecond resolution. */
|
||||||
|
+ nanosecond resolution. We provide a fallback for ENOSYS (for
|
||||||
|
+ example, compiling against Linux 2.6.25 kernel headers and glibc
|
||||||
|
+ 2.7, but running on Linux 2.6.18 kernel). */
|
||||||
|
#if HAVE_UTIMENSAT
|
||||||
|
if (fd < 0)
|
||||||
|
- return utimensat (AT_FDCWD, file, timespec, 0);
|
||||||
|
+ {
|
||||||
|
+ int result = utimensat (AT_FDCWD, file, timespec, 0);
|
||||||
|
+ if (result == 0 || errno != ENOSYS)
|
||||||
|
+ return result;
|
||||||
|
+ }
|
||||||
|
#endif
|
||||||
|
#if HAVE_FUTIMENS
|
||||||
|
- return futimens (fd, timespec);
|
||||||
|
-#else
|
||||||
|
+ {
|
||||||
|
+ int result = futimens (fd, timespec);
|
||||||
|
+ if (result == 0 || errno != ENOSYS)
|
||||||
|
+ return result;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
/* The platform lacks an interface to set file timestamps with
|
||||||
|
nanosecond resolution, so do the best we can, discarding any
|
||||||
|
fractional part of the timestamp. */
|
||||||
|
{
|
||||||
|
-# if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
|
||||||
|
+#if HAVE_FUTIMESAT || HAVE_WORKING_UTIMES
|
||||||
|
struct timeval timeval[2];
|
||||||
|
struct timeval const *t;
|
||||||
|
if (timespec)
|
||||||
|
@@ -125,9 +135,9 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
||||||
|
|
||||||
|
if (fd < 0)
|
||||||
|
{
|
||||||
|
-# if HAVE_FUTIMESAT
|
||||||
|
+# if HAVE_FUTIMESAT
|
||||||
|
return futimesat (AT_FDCWD, file, t);
|
||||||
|
-# endif
|
||||||
|
+# endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@@ -141,21 +151,21 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
||||||
|
worth optimizing, and who knows what other messed-up systems
|
||||||
|
are out there? So play it safe and fall back on the code
|
||||||
|
below. */
|
||||||
|
-# if HAVE_FUTIMESAT
|
||||||
|
+# if HAVE_FUTIMESAT
|
||||||
|
if (futimesat (fd, NULL, t) == 0)
|
||||||
|
return 0;
|
||||||
|
-# elif HAVE_FUTIMES
|
||||||
|
+# elif HAVE_FUTIMES
|
||||||
|
if (futimes (fd, t) == 0)
|
||||||
|
return 0;
|
||||||
|
-# endif
|
||||||
|
+# endif
|
||||||
|
}
|
||||||
|
-# endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
|
||||||
|
+#endif /* HAVE_FUTIMESAT || HAVE_WORKING_UTIMES */
|
||||||
|
|
||||||
|
if (!file)
|
||||||
|
{
|
||||||
|
-# if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
|
||||||
|
+#if ! (HAVE_FUTIMESAT || (HAVE_WORKING_UTIMES && HAVE_FUTIMES))
|
||||||
|
errno = ENOSYS;
|
||||||
|
-# endif
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
/* Prefer EBADF to ENOSYS if both error numbers apply. */
|
||||||
|
if (errno == ENOSYS)
|
||||||
|
@@ -170,9 +180,9 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
-# if HAVE_WORKING_UTIMES
|
||||||
|
+#if HAVE_WORKING_UTIMES
|
||||||
|
return utimes (file, t);
|
||||||
|
-# else
|
||||||
|
+#else
|
||||||
|
{
|
||||||
|
struct utimbuf utimbuf;
|
||||||
|
struct utimbuf const *ut;
|
||||||
|
@@ -187,9 +197,8 @@ gl_futimens (int fd ATTRIBUTE_UNUSED,
|
||||||
|
|
||||||
|
return utime (file, ut);
|
||||||
|
}
|
||||||
|
-# endif /* !HAVE_WORKING_UTIMES */
|
||||||
|
+#endif /* !HAVE_WORKING_UTIMES */
|
||||||
|
}
|
||||||
|
-#endif /* !HAVE_FUTIMENS */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set the access and modification time stamps of FILE to be
|
||||||
|
--
|
||||||
|
1.5.5.1
|
Loading…
Reference in New Issue
Block a user