[SCM] Git repository for pkg-virtuoso branch, master, updated. debian/6.1.4+dfsg1-3-25-gc39d81a
Maximiliano Curia
maxy at gnuservers.com.ar
Wed Jun 12 08:30:29 UTC 2013
The following commit has been merged in the master branch:
commit c39d81a1fe210ad1e238aa5aa2ed20a5313c269d
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date: Wed Jun 12 10:30:12 2013 +0200
Update path: do_not_depend_on_MAXPATHLEN.patch.
diff --git a/debian/changelog b/debian/changelog
index a95e3e4..aa4c795 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
virtuoso-opensource (6.1.6+dfsg-3) UNRELEASED; urgency=low
* Remove mono package for armhf.
+ * Update path: do_not_depend_on_MAXPATHLEN.patch.
-- Maximiliano Curia <maxy at debian.org> Wed, 12 Jun 2013 10:11:31 +0200
diff --git a/debian/patches/do_not_depend_on_MAXPATHLEN.patch b/debian/patches/do_not_depend_on_MAXPATHLEN.patch
index 3faa6f1..a99fb9a 100644
--- a/debian/patches/do_not_depend_on_MAXPATHLEN.patch
+++ b/debian/patches/do_not_depend_on_MAXPATHLEN.patch
@@ -1,4 +1,4 @@
-commit 5323b0344114fe5210f1d03d6753646499f7cd8e
+commit 9ef5dd10723f7341f0e1ac85cf7f0e42d9c781a4
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date: Mon Jun 10 15:23:25 2013 +0200
@@ -38,15 +38,17 @@ index 0695097..ae1daca 100644
dk_free_box (md5_val);
vfc_printf (("vfc_fcgi_server_allocate ret =%p\n",
diff --git a/libsrc/util/fnsearch.c b/libsrc/util/fnsearch.c
-index 62f566e..fc76608 100644
+index 62f566e..92bb7ab 100644
--- a/libsrc/util/fnsearch.c
+++ b/libsrc/util/fnsearch.c
-@@ -40,14 +40,21 @@
+@@ -40,14 +40,31 @@
char *
fnsearch (const char *filename, const char *path)
{
- static char namebuf[MAXPATHLEN];
+ static char *namebuf = NULL;
++ static size_t namebuf_size = 0;
++ size_t new_size;
const char *cp;
char *np;
@@ -55,34 +57,51 @@ index 62f566e..fc76608 100644
- np = namebuf;
cp = path;
+
-+ /* Ask for enough space to store the result */
-+ /* note that realloc of NULL behaves like malloc */
-+ np = realloc(namebuf, strlen(path) + strlen(filename) + 2);
-+ if (np == NULL)
-+ return NULL;
-+ namebuf = np;
++ /* Avoid a call to realloc, whenever posible */
++ new_size = strlen(path) + strlen(filename) + 2;
++ if (namebuf_size < new_size)
++ {
++ /* Ask more than enough space to store the result */
++ /* (realloc of NULL behaves like malloc) */
++ np = realloc(namebuf, new_size);
++ if (np == NULL)
++ return NULL;
++ namebuf_size = new_size;
++ namebuf = np;
++ }
++ else
++ np = namebuf;
+
while (1)
{
if (*cp == PATHSEP || *cp == '\0')
diff --git a/libsrc/util/setext.c b/libsrc/util/setext.c
-index d7c0295..7afb834 100644
+index d7c0295..e0dd80f 100644
--- a/libsrc/util/setext.c
+++ b/libsrc/util/setext.c
-@@ -46,10 +46,16 @@
+@@ -46,10 +46,25 @@
char *
setext (const char *path, const char *ext, int mode)
{
- static char name[MAXPATHLEN];
+ static char *name = NULL;
++ static size_t name_size = 0;
++ size_t new_size;
char *slash;
char *dot;
-+ /* A bit more space than really needed */
-+ dot = realloc(name, strlen(path) + strlen(ext) + 2);
-+ if (dot == NULL)
-+ return NULL;
-+ name = dot;
++ /* Avoid a call to realloc, whenever posible */
++ new_size = strlen(path) + strlen(ext) + 2;
++ if (name_size < new_size)
++ {
++ /* Ask more than enough space to store the result */
++ /* (realloc of NULL behaves like malloc) */
++ dot = realloc(name, new_size);
++ if (dot == NULL)
++ return NULL;
++ name_size = new_size;
++ name = dot;
++ }
+
strcpy (name, path);
--
Git repository for pkg-virtuoso
More information about the Pkg-virtuoso-commits
mailing list