two bugs on compiling cpio 2.6 for freebsd 5.4:
- function "isnumber" in src/userspec.c is a libc function
NAME
isdigit, isnumber -- decimal-digit character test
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <ctype.h>
int
isdigit(int c);
int
isnumber(int c);
DESCRIPTION
The isdigit() function tests for a decimal digit character.
Regardless
of locale, this includes the following characters only:
``0'' ``1'' ``2'' ``3'' ``4''
``5'' ``6'' ``7'' ``8'' ``9''
The isnumber() function behaves similarly to isdigit(), but
may recognize
additional characters, depending on the current locale setting.
replaced with "isnumberstring"
- "alloca" in src/userspec.c and src/makepath.c may not become overridden
with __builtin_alloca because it's defined inside alloca.h
added #ifdef __FreeBSD__ ...
diff attached
--
Gruss / Best regards | LF.net GmbH | fon +49 711 90074-0
Chris Recktenwald | Ruppmannstr. 27 | fax +49 711 90074-33
[EMAIL PROTECTED] | D-70565 Stuttgart | http://www.lf.net
--- cpio-2.6/src/userspec.c.orig Mon Jul 4 15:37:14 2005
+++ cpio-2.6/src/userspec.c Mon Jul 4 16:44:26 2005
@@ -19,6 +19,9 @@
#include <system.h>
+#ifdef __FreeBSD__
+#include <alloca.h>
+#else
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
@@ -32,6 +35,7 @@
#endif
#endif
#endif
+#endif
#include <stdio.h>
#include <ctype.h>
@@ -72,7 +76,7 @@
otherwise return 0. */
static int
-isnumber (const char *str)
+isnumberstring (const char *str)
{
for (; *str; str++)
if (!isdigit (*str))
@@ -136,7 +140,7 @@
if (pwd == NULL)
{
- if (!isnumber (u))
+ if (!isnumberstring (u))
error_msg = _("invalid user");
else
{
@@ -182,7 +186,7 @@
grp = getgrnam (g);
if (grp == NULL)
{
- if (!isnumber (g))
+ if (!isnumberstring (g))
error_msg = _("invalid group");
else
*gid = atoi (g);
--- cpio-2.6/src/makepath.c.orig Mon Jul 4 16:44:55 2005
+++ cpio-2.6/src/makepath.c Mon Jul 4 16:45:31 2005
@@ -24,6 +24,8 @@
#include <system.h>
+#ifdef __FreeBSD__
+#else
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
@@ -34,6 +36,7 @@
#pragma alloca
#else
char *alloca ();
+#endif
#endif
#endif
#endif
_______________________________________________
Bug-cpio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-cpio