bug-patch
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-patch] [bug-report] could not generate stdbool.h and xstrndup.o


From: Yasutaka SHINDOH
Subject: [bug-patch] [bug-report] could not generate stdbool.h and xstrndup.o
Date: Sat, 14 Nov 2009 08:47:17 +0900
User-agent: Wanderlust/2.14.0 (Africa) EMIKO/1.14.1 (襟鞭毛虫) LIMIT/1.14.10 (古市) APEL/10.7 EasyPG/0.0.16 Emacs/22.3 (i486-apple-darwin9.8.0) MULE/5.0 (賢木)

Hi there,

GNU patch 2.6 has the following bugs.

        - could not generate gl/lib/stdbool.h
        - could not compile gl/lib/xstrndup.c (Mac OS X)

============================================================

diff -rNbu patch-2.6.orig/Makefile.in patch-2.6/Makefile.in
--- patch-2.6.orig/Makefile.in  2009-11-14 08:35:31 +0900
+++ patch-2.6/Makefile.in       2009-11-14 08:35:11 +0900
@@ -44,7 +44,7 @@
 OBJEXT = @OBJEXT@
 PACKAGE_NAME = @PACKAGE_NAME@
 PACKAGE_VERSION = @PACKAGE_VERSION@
-STDBOOL_H = @STDBOOL_H@
+STDBOOL_H = gl/lib/@STDBOOL_H@
 ifneq (@GETOPT_H@,)
 GETOPT_H = gl/lib/@GETOPT_H@
 endif
@@ -270,7 +270,7 @@
 
 # We need the following in order to create <stdbool.h> when the system
 # doesn't have one that works.
-gl/lib/stdbool.h: gl/lib/stdbool.hin
+$(STDBOOL_H): gl/lib/stdbool.hin
        rm -f address@hidden $@
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' \
diff -rNbu patch-2.6.orig/gl/lib/xstrndup.c patch-2.6/gl/lib/xstrndup.c
--- patch-2.6.orig/gl/lib/xstrndup.c    2009-11-14 08:35:31 +0900
+++ patch-2.6/gl/lib/xstrndup.c 2009-11-14 08:35:11 +0900
@@ -20,6 +20,7 @@
 /* Specification.  */
 #include "xstrndup.h"
 
+#include <stdlib.h>
 #include <string.h>
 #include "xalloc.h"
 
@@ -29,8 +30,12 @@
 char *
 xstrndup (const char *string, size_t n)
 {
-  char *s = strndup (string, n);
-  if (! s)
+  char *s = malloc(n);
+  if (! s) {
     xalloc_die ();
+  }
+  else {
+    memcpy(s, string, n);
+  }
   return s;
 }

============================================================

-- 
Yasutaka SHINDOH ___ We will either find a way, or make one.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]