bug#48070: sort.exe cannot do ascii ordering but help says it can.

2021-04-27 Thread Bernhard Voelker
On 4/27/21 7:39 PM, Peter SMITH1 (contractor) via GNU coreutils Bug Reports 
wrote:
> CONFIDENTIAL & RESTRICTED

This cannot be enforced on a public mailing list, for obvious reasons.

> Hello,
> 
> C:\gener\gnuutils>\bin\sort --version
> sort (GNU coreutils) 5.3.0
> Written by Mike Haertel and Paul Eggert.
> 
> Copyright (C) 2005 Free Software Foundation, Inc.

This is a report with a 16-year-old version of the tool.
Not sure if the issue - if any - still exists in the current version (8.32)

Furthermore, you are using a Windows binary - usually one would try to
seek help at the creator of that, i.e., the distributor, first.

> C:\gener\gnuutils>type test.dat
> 
> 
> 
> 
> 
> C:\gener\gnuutils>set LC_ALL=C
> 
> C:\gener\gnuutils>\bin\sort test.dat
> 
> 
> 
> 
> 
> C:\gener\gnuutils>

It seems that the locale information available to sort differs from that
of a current system:

  $ env LC_ALL=C sort test.dat
  
  
  
  

or that your version of sort enables case-folding (-f):

  $ LC_ALL=C sort -f test.dat
  
  
  
  

As the version you are using is that old, and the environment is quite 
different,
I'm afraid we cannot help much here.  First, I'd try to get a newer build and
see if the problem still exists.

Have a nice day,
Berny





bug#48070: sort.exe cannot do ascii ordering but help says it can.

2021-04-27 Thread Peter SMITH1 (contractor)
CONFIDENTIAL & RESTRICTED

Hello,

C:\gener\gnuutils>\bin\sort --version
sort (GNU coreutils) 5.3.0
Written by Mike Haertel and Paul Eggert.

Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Usage: \bin\sort [OPTION]... [FILE]...
Write sorted concatenation of all FILE(s) to standard output.

Ordering options:

Mandatory arguments to long options are mandatory for short options too.
  -b, --ignore-leading-blanks ignore leading blanks
  -d, --dictionary-order  consider only blanks and alphanumeric characters
  -f, --ignore-case   fold lower case to upper case characters
  -g, --general-numeric-sort  compare according to general numerical value
  -i, --ignore-nonprintingconsider only printable characters
  -M, --month-sortcompare (unknown) < `JAN' < ... < `DEC'
  -n, --numeric-sort  compare according to string numerical value
  -r, --reverse   reverse the result of comparisons

Other options:

  -c, --check   check whether input is sorted; do not sort
  -k, --key=POS1[,POS2] start a key at POS1, end it at POS 2 (origin 1)
  -m, --merge   merge already sorted files; do not sort
  -o, --output=FILE write result to FILE instead of standard output
  -s, --stable  stabilize sort by disabling last-resort comparison
  -S, --buffer-size=SIZEuse SIZE for main memory buffer
  -t, --field-separator=SEP use SEP instead of non-blank to blank transition
  -T, --temporary-directory=DIR  use DIR for temporaries, not $TMPDIR or /tmp;
  multiple options specify multiple directories
  -u, --unique  with -c, check for strict ordering;
  without -c, output only the first of an equal run
  -z, --zero-terminated end lines with 0 byte, not newline
  --help display this help and exit
  --version  output version information and exit

POS is F[.C][OPTS], where F is the field number and C the character position
in the field.  OPTS is one or more single-letter ordering options, which
override global ordering options for that key.  If no key is given, use the
entire line as the key.

SIZE may be followed by the following multiplicative suffixes:
% 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y.

With no FILE, or when FILE is -, read standard input.

*** WARNING ***
The locale specified by the environment affects sort order.
Set LC_ALL=C to get the traditional sort order that uses
native byte values.

Report bugs to .


C:\gener\gnuutils>notepad help

C:\gener\gnuutils>type test.dat





C:\gener\gnuutils>set LC_ALL=C

C:\gener\gnuutils>\bin\sort test.dat





C:\gener\gnuutils>



bug#48034: git coreutils ./bootstrap failure

2021-04-27 Thread Paul Eggert

On 4/26/21 3:29 AM, David L. Craig wrote:


configure.ac:55: warning: The macro `AC_PROG_CC_STDC' is obsolete.


I reproduced these warnings; they come from Autoconf 2.71. You can 
ignore them, or you can update to the latest coreutils on Savannah, 
where I installed some patches (attached) to silence these.



doc/local.mk:19: installing 'build-aux/mdate-sh'
Makefile.am:213:   'doc/local.mk' included from here
doc/local.mk:19: error: required file 'build-aux/texinfo.tex' not found
Makefile.am:213:   'doc/local.mk' included from here


I don't observe this problem. gnulib-tool sets up a symlink that works:

$ ls -l build-aux/texinfo.tex gnulib/build-aux/texinfo.tex
lrwxrwxrwx 1 eggert eggert 31 Apr 26 23:59 build-aux/texinfo.tex -> 
../gnulib/build-aux/texinfo.tex

-rw-rw-r-- 1 eggert eggert 379274 Apr 26 23:56 gnulib/build-aux/texinfo.tex

If you still observe a problem with a fresh build from scratch, please 
investigate why gnulib-tool isn't setting up that link for you
From 1c97d9e2af40003a8ad872fb7f31d4e616f52532 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Mon, 26 Apr 2021 18:02:16 -0700
Subject: [PATCH 1/3] build: update gnulib submodule to latest

* src/csplit.c (load_buffer):
* src/pinky.c (create_fullname):
Use intprops-based checks rather than xalloc_oversized,
since Gnulib xalloc.h no longer includes xalloc-oversized.h.
---
 gnulib   | 2 +-
 src/csplit.c | 3 +--
 src/pinky.c  | 6 +++---
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/gnulib b/gnulib
index e54b645fc..354b9691a 16
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit e54b645fc6b8422562327443bda575c65d931fbd
+Subproject commit 354b9691accd00a531358b652689ce7f580fbe54
diff --git a/src/csplit.c b/src/csplit.c
index ee9aa6503..79bd034e3 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -518,9 +518,8 @@ load_buffer (void)
   if (lines_found || have_read_eof)
 break;
 
-  if (xalloc_oversized (2, b->bytes_alloc))
+  if (INT_MULTIPLY_WRAPV (b->bytes_alloc, 2, &bytes_wanted))
 xalloc_die ();
-  bytes_wanted = 2 * b->bytes_alloc;
   free_buffer (b);
   free (b);
 }
diff --git a/src/pinky.c b/src/pinky.c
index 23a43f5e4..6fea94923 100644
--- a/src/pinky.c
+++ b/src/pinky.c
@@ -110,9 +110,9 @@ create_fullname (char const *gecos_name, char const *user_name)
   if (ampersands != 0)
 {
   size_t ulen = strlen (user_name);
-  size_t product = ampersands * ulen;
-  rsize += product - ampersands;
-  if (xalloc_oversized (ulen, ampersands) || rsize < product)
+  size_t product;
+  if (INT_MULTIPLY_WRAPV (ulen, ampersands - 1, &product)
+  || INT_ADD_WRAPV (rsize, product, &rsize))
 xalloc_die ();
 }
 
-- 
2.27.0

From 1671951e05096200aeb87ca6729fcccd2901 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Mon, 26 Apr 2021 20:04:19 -0700
Subject: [PATCH 2/3] csplit: size_t overflow check

* src/csplit.c (get_new_buffer): Fix unlikely size_t overflow.
---
 src/csplit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/csplit.c b/src/csplit.c
index 79bd034e3..f188e8894 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -416,7 +416,8 @@ get_new_buffer (size_t min_size)
   if (alloc_size < min_size)
 {
   size_t s = min_size - alloc_size + INCR_SIZE - 1;
-  alloc_size += s - s % INCR_SIZE;
+  if (INT_ADD_WRAPV (alloc_size, s - s % INCR_SIZE, &alloc_size))
+xalloc_die ();
 }
 
   new_buffer = create_new_buffer (alloc_size);
-- 
2.27.0

From 96a034f490595258f9069a3fed037ddc65df2c71 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Mon, 26 Apr 2021 23:27:59 -0700
Subject: [PATCH 3/3] maint: port to Autoconf 2.71

* configure.ac: Use AC_PROG_CC, not AC_PROG_CC_STDC.
* gl/modules/smack (configure.ac):
* m4/jm-macros.m4 (coreutils_MACROS):
* m4/xattr.m4 (gl_FUNC_XATTR):
Use AS_HELP_STRING, not AC_HELP_STRING.
* m4/check-decl.m4 (gl_CHECK_DECLS):
Do not require AC_HEADER_TIME; we no longer care about it directly.
* m4/jm-macros.m4 (coreutils_MACROS):
Do not require AC_ISC_POSIX, which became obsolete in 2006.
Use AC_LINK_IFELSE instead of AC_TRY_LINK.
---
 configure.ac |  2 +-
 gl/modules/smack |  2 +-
 m4/check-decl.m4 |  4 +---
 m4/jm-macros.m4  | 54 +++-
 m4/xattr.m4  |  4 ++--
 5 files changed, 35 insertions(+), 31 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7fbecbf8d..02291a4ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,7 +52,7 @@ m4_syscmd([test "${GNULIB_POSIXCHECK+set}" = set])
 m4_if(m4_sysval, [0], [], [dnl
 gl_ASSERT_NO_GNULIB_POSIXCHECK])
 
-AC_PROG_CC_STDC
+AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_CPP
 AC_PROG_GCC_TRADITIONAL
diff --git a/gl/modules/smack b/gl/modules/smack
index a6dcbaa62..1c4a541a6 100644
--- a/gl/modules/smack
+++ b/gl/modules/smack
@@ -10,7 +10,7 @@ configure.ac:
 # Check whether libsmack is available
 LIB_SMACK=
 AC_ARG_ENABLE([libsmack],
-  AC_HELP_STRING([--disable-libsmack],