]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Use regex module without dependency on 'malloc'.
authorBruno Haible <bruno@clisp.org>
Mon, 24 May 2010 10:40:00 +0000 (12:40 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 3 Jun 2010 13:04:25 +0000 (15:04 +0200)
gnulib-local/ChangeLog
gnulib-local/Makefile.am
gnulib-local/lib/regex_internal.h.diff [new file with mode: 0644]
gnulib-local/lib/regexec.c.diff [new file with mode: 0644]
gnulib-local/modules/regex.diff [new file with mode: 0644]

index 82f74567fdafb2d2eb3ea2b3ae5577c34016221b..919f2ce5391d89d47348afccf583aa45cb8f9012 100644 (file)
@@ -1,3 +1,11 @@
+2010-05-24  Bruno Haible  <bruno@clisp.org>
+
+       Use regex module without dependency on 'malloc'.
+       * lib/regex_internal.h.diff: New file.
+       * lib/regexec.c.diff: New file.
+       * modules/regex.diff: New file.
+       * Makefile.am (EXTRA_DIST): Add them.
+
 2010-05-23  Bruno Haible  <bruno@clisp.org>
 
        Do regex matching purely with regex, not regex + dfa + kwset.
index a46d7b3db354a63b63ed8adf599b8265a11f3baa..f924ad3aaec3a8a3fb1cae748d0c3cb33d10a551 100644 (file)
@@ -222,6 +222,8 @@ lib/obstack.h.diff \
 lib/ostream.oo.c \
 lib/ostream.oo.h \
 lib/progname.h.diff \
+lib/regexec.c.diff \
+lib/regex_internal.h.diff \
 lib/styled-ostream.oo.c \
 lib/styled-ostream.oo.h \
 lib/term-ostream.oo.c \
@@ -282,6 +284,7 @@ modules/moo-tests \
 modules/ostream \
 modules/quotearg.diff \
 modules/quote.diff \
+modules/regex.diff \
 modules/styled-ostream \
 modules/termcap \
 modules/termcap-h \
diff --git a/gnulib-local/lib/regex_internal.h.diff b/gnulib-local/lib/regex_internal.h.diff
new file mode 100644 (file)
index 0000000..bfcc242
--- /dev/null
@@ -0,0 +1,19 @@
+*** lib/regex_internal.h.orig  Mon May 24 12:36:55 2010
+--- lib/regex_internal.h       Mon May 24 12:35:46 2010
+***************
+*** 476,482 ****
+  # define MAX(a,b) ((a) < (b) ? (b) : (a))
+  #endif
+  
+! #define re_malloc(t,n) ((t *) malloc ((n) * sizeof (t)))
+  #define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t)))
+  #define re_free(p) free (p)
+  
+--- 476,482 ----
+  # define MAX(a,b) ((a) < (b) ? (b) : (a))
+  #endif
+  
+! #define re_malloc(t,n) ((t *) malloc ((n) > 0 ? (n) * sizeof (t) : 1))
+  #define re_realloc(p,t,n) ((t *) realloc (p, (n) * sizeof (t)))
+  #define re_free(p) free (p)
+  
diff --git a/gnulib-local/lib/regexec.c.diff b/gnulib-local/lib/regexec.c.diff
new file mode 100644 (file)
index 0000000..eede896
--- /dev/null
@@ -0,0 +1,19 @@
+*** lib/regexec.c.orig Mon May 24 12:36:55 2010
+--- lib/regexec.c      Mon May 24 12:34:41 2010
+***************
+*** 3425,3431 ****
+    else
+      {
+        dest_states = (re_dfastate_t **)
+!      malloc (ndests * 3 * sizeof (re_dfastate_t *));
+        if (BE (dest_states == NULL, 0))
+       {
+  out_free:
+--- 3425,3431 ----
+    else
+      {
+        dest_states = (re_dfastate_t **)
+!      re_malloc (re_dfastate_t *, ndests * 3);
+        if (BE (dest_states == NULL, 0))
+       {
+  out_free:
diff --git a/gnulib-local/modules/regex.diff b/gnulib-local/modules/regex.diff
new file mode 100644 (file)
index 0000000..ccba549
--- /dev/null
@@ -0,0 +1,19 @@
+*** modules/regex.orig Mon May 24 12:36:55 2010
+--- modules/regex      Mon May 24 12:36:42 2010
+***************
+*** 17,23 ****
+  extensions
+  gettext-h
+  localcharset
+! malloc
+  memcmp
+  memmove
+  mbrtowc
+--- 17,23 ----
+  extensions
+  gettext-h
+  localcharset
+! malloc-posix
+  memcmp
+  memmove
+  mbrtowc