revert a gnulib patch that broke the build
This commit is contained in:
parent
f33a14f44f
commit
1c60283cdf
276
coreutils-9.3-gnulib-strtol.patch
Normal file
276
coreutils-9.3-gnulib-strtol.patch
Normal file
@ -0,0 +1,276 @@
|
||||
From eca8f2dd212de534778c874a52ca079659e30140 Mon Sep 17 00:00:00 2001
|
||||
From: Kamil Dudka <kdudka@redhat.com>
|
||||
Date: Tue, 18 Apr 2023 17:57:42 +0200
|
||||
Subject: [PATCH] Revert "strtol, strtoll, strtoul, strtoull: Make ISO C 23
|
||||
compliant."
|
||||
|
||||
This reverts commit 4e38f4a0c65d4d19883b404a84169088b84b60d2.
|
||||
---
|
||||
gnulib-tests/test-strtoll.c | 62 ------------------------------------
|
||||
gnulib-tests/test-strtoull.c | 62 ------------------------------------
|
||||
lib/strtol.c | 14 ++------
|
||||
m4/strtoll.m4 | 19 +++--------
|
||||
m4/strtoull.m4 | 19 +++--------
|
||||
5 files changed, 11 insertions(+), 165 deletions(-)
|
||||
|
||||
diff --git a/gnulib-tests/test-strtoll.c b/gnulib-tests/test-strtoll.c
|
||||
index 24cb4eb..ecedbe6 100644
|
||||
--- a/gnulib-tests/test-strtoll.c
|
||||
+++ b/gnulib-tests/test-strtoll.c
|
||||
@@ -239,67 +239,5 @@ main (void)
|
||||
ASSERT (errno == 0);
|
||||
}
|
||||
|
||||
- /* Binary integer syntax. */
|
||||
- {
|
||||
- const char input[] = "0b111010";
|
||||
- char *ptr;
|
||||
- long long result;
|
||||
- errno = 0;
|
||||
- result = strtoll (input, &ptr, 10);
|
||||
- ASSERT (result == 0LL);
|
||||
- ASSERT (ptr == input + 1);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b111010";
|
||||
- char *ptr;
|
||||
- long long result;
|
||||
- errno = 0;
|
||||
- result = strtoll (input, &ptr, 2);
|
||||
- ASSERT (result == 58LL);
|
||||
- ASSERT (ptr == input + 8);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b111010";
|
||||
- char *ptr;
|
||||
- long long result;
|
||||
- errno = 0;
|
||||
- result = strtoll (input, &ptr, 0);
|
||||
- ASSERT (result == 58LL);
|
||||
- ASSERT (ptr == input + 8);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b";
|
||||
- char *ptr;
|
||||
- long long result;
|
||||
- errno = 0;
|
||||
- result = strtoll (input, &ptr, 10);
|
||||
- ASSERT (result == 0LL);
|
||||
- ASSERT (ptr == input + 1);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b";
|
||||
- char *ptr;
|
||||
- long long result;
|
||||
- errno = 0;
|
||||
- result = strtoll (input, &ptr, 2);
|
||||
- ASSERT (result == 0LL);
|
||||
- ASSERT (ptr == input + 1);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b";
|
||||
- char *ptr;
|
||||
- long long result;
|
||||
- errno = 0;
|
||||
- result = strtoll (input, &ptr, 0);
|
||||
- ASSERT (result == 0LL);
|
||||
- ASSERT (ptr == input + 1);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
diff --git a/gnulib-tests/test-strtoull.c b/gnulib-tests/test-strtoull.c
|
||||
index 7b0027f..dd6ec2a 100644
|
||||
--- a/gnulib-tests/test-strtoull.c
|
||||
+++ b/gnulib-tests/test-strtoull.c
|
||||
@@ -238,67 +238,5 @@ main (void)
|
||||
ASSERT (errno == 0);
|
||||
}
|
||||
|
||||
- /* Binary integer syntax. */
|
||||
- {
|
||||
- const char input[] = "0b111010";
|
||||
- char *ptr;
|
||||
- unsigned long long result;
|
||||
- errno = 0;
|
||||
- result = strtoull (input, &ptr, 10);
|
||||
- ASSERT (result == 0ULL);
|
||||
- ASSERT (ptr == input + 1);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b111010";
|
||||
- char *ptr;
|
||||
- unsigned long long result;
|
||||
- errno = 0;
|
||||
- result = strtoull (input, &ptr, 2);
|
||||
- ASSERT (result == 58ULL);
|
||||
- ASSERT (ptr == input + 8);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b111010";
|
||||
- char *ptr;
|
||||
- unsigned long long result;
|
||||
- errno = 0;
|
||||
- result = strtoull (input, &ptr, 0);
|
||||
- ASSERT (result == 58ULL);
|
||||
- ASSERT (ptr == input + 8);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b";
|
||||
- char *ptr;
|
||||
- unsigned long long result;
|
||||
- errno = 0;
|
||||
- result = strtoull (input, &ptr, 10);
|
||||
- ASSERT (result == 0ULL);
|
||||
- ASSERT (ptr == input + 1);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b";
|
||||
- char *ptr;
|
||||
- unsigned long long result;
|
||||
- errno = 0;
|
||||
- result = strtoull (input, &ptr, 2);
|
||||
- ASSERT (result == 0ULL);
|
||||
- ASSERT (ptr == input + 1);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
- {
|
||||
- const char input[] = "0b";
|
||||
- char *ptr;
|
||||
- unsigned long long result;
|
||||
- errno = 0;
|
||||
- result = strtoull (input, &ptr, 0);
|
||||
- ASSERT (result == 0ULL);
|
||||
- ASSERT (ptr == input + 1);
|
||||
- ASSERT (errno == 0);
|
||||
- }
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
diff --git a/lib/strtol.c b/lib/strtol.c
|
||||
index b93483d..d11269b 100644
|
||||
--- a/lib/strtol.c
|
||||
+++ b/lib/strtol.c
|
||||
@@ -288,11 +288,6 @@ INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
|
||||
s += 2;
|
||||
base = 16;
|
||||
}
|
||||
- else if ((base == 0 || base == 2) && TOUPPER (s[1]) == L_('B'))
|
||||
- {
|
||||
- s += 2;
|
||||
- base = 2;
|
||||
- }
|
||||
else if (base == 0)
|
||||
base = 8;
|
||||
}
|
||||
@@ -383,14 +378,11 @@ INTERNAL (strtol) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
|
||||
noconv:
|
||||
/* We must handle a special case here: the base is 0 or 16 and the
|
||||
first two characters are '0' and 'x', but the rest are no
|
||||
- hexadecimal digits. Likewise when the base is 0 or 2 and the
|
||||
- first two characters are '0' and 'b', but the rest are no binary
|
||||
- digits. This is no error case. We return 0 and ENDPTR points to
|
||||
- the 'x' or 'b'. */
|
||||
+ hexadecimal digits. This is no error case. We return 0 and
|
||||
+ ENDPTR points to the 'x'. */
|
||||
if (endptr != NULL)
|
||||
{
|
||||
- if (save - nptr >= 2
|
||||
- && (TOUPPER (save[-1]) == L_('X') || TOUPPER (save[-1]) == L_('B'))
|
||||
+ if (save - nptr >= 2 && TOUPPER (save[-1]) == L_('X')
|
||||
&& save[-2] == L_('0'))
|
||||
*endptr = (STRING_TYPE *) &save[-1];
|
||||
else
|
||||
diff --git a/m4/strtoll.m4 b/m4/strtoll.m4
|
||||
index ec09609..ede630c 100644
|
||||
--- a/m4/strtoll.m4
|
||||
+++ b/m4/strtoll.m4
|
||||
@@ -1,4 +1,4 @@
|
||||
-# strtoll.m4 serial 10
|
||||
+# strtoll.m4 serial 9
|
||||
dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
@@ -24,26 +24,15 @@ AC_DEFUN([gl_FUNC_STRTOLL],
|
||||
if (term != input + 1)
|
||||
result |= 1;
|
||||
}
|
||||
- /* This test fails on pre-C23 platforms. */
|
||||
- {
|
||||
- const char input[] = "0b1";
|
||||
- (void) strtoll (input, &term, 2);
|
||||
- if (term != input + 3)
|
||||
- result |= 2;
|
||||
- }
|
||||
return result;
|
||||
]])
|
||||
],
|
||||
[gl_cv_func_strtoll_works=yes],
|
||||
[gl_cv_func_strtoll_works=no],
|
||||
[case "$host_os" in
|
||||
- # Guess no on native Windows.
|
||||
- mingw*) gl_cv_func_strtoll_works="guessing no" ;;
|
||||
- # Guess no on glibc systems.
|
||||
- *-gnu* | gnu*) gl_cv_func_strtoll_works="guessing no" ;;
|
||||
- # Guess no on musl systems.
|
||||
- *-musl* | midipix*) gl_cv_func_strtoll_works="guessing no" ;;
|
||||
- *) gl_cv_func_strtoll_works="$gl_cross_guess_normal" ;;
|
||||
+ # Guess no on native Windows.
|
||||
+ mingw*) gl_cv_func_strtoll_works="guessing no" ;;
|
||||
+ *) gl_cv_func_strtoll_works="$gl_cross_guess_normal" ;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
diff --git a/m4/strtoull.m4 b/m4/strtoull.m4
|
||||
index 4f895c7..a9b0ddf 100644
|
||||
--- a/m4/strtoull.m4
|
||||
+++ b/m4/strtoull.m4
|
||||
@@ -1,4 +1,4 @@
|
||||
-# strtoull.m4 serial 10
|
||||
+# strtoull.m4 serial 9
|
||||
dnl Copyright (C) 2002, 2004, 2006, 2008-2023 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
@@ -24,26 +24,15 @@ AC_DEFUN([gl_FUNC_STRTOULL],
|
||||
if (term != input + 1)
|
||||
result |= 1;
|
||||
}
|
||||
- /* This test fails on pre-C23 platforms. */
|
||||
- {
|
||||
- const char input[] = "0b1";
|
||||
- (void) strtoull (input, &term, 2);
|
||||
- if (term != input + 3)
|
||||
- result |= 2;
|
||||
- }
|
||||
return result;
|
||||
]])
|
||||
],
|
||||
[gl_cv_func_strtoull_works=yes],
|
||||
[gl_cv_func_strtoull_works=no],
|
||||
[case "$host_os" in
|
||||
- # Guess no on native Windows.
|
||||
- mingw*) gl_cv_func_strtoull_works="guessing no" ;;
|
||||
- # Guess no on glibc systems.
|
||||
- *-gnu* | gnu*) gl_cv_func_strtoull_works="guessing no" ;;
|
||||
- # Guess no on musl systems.
|
||||
- *-musl* | midipix*) gl_cv_func_strtoull_works="guessing no" ;;
|
||||
- *) gl_cv_func_strtoull_works="$gl_cross_guess_normal" ;;
|
||||
+ # Guess no on native Windows.
|
||||
+ mingw*) gl_cv_func_strtoull_works="guessing no" ;;
|
||||
+ *) gl_cv_func_strtoull_works="$gl_cross_guess_normal" ;;
|
||||
esac
|
||||
])
|
||||
])
|
||||
--
|
||||
2.39.2
|
||||
|
@ -14,6 +14,9 @@ Source51: coreutils-provides.inc
|
||||
Source105: coreutils-colorls.sh
|
||||
Source106: coreutils-colorls.csh
|
||||
|
||||
# revert a gnulib patch that broke the build
|
||||
Patch1: coreutils-9.3-gnulib-strtol.patch
|
||||
|
||||
# do not make coreutils-single depend on /usr/bin/coreutils
|
||||
%global __requires_exclude ^%{_bindir}/coreutils$
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user