[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU M4 source repository branch, master, updated. cvs-readonly-349
From: |
Gary V. Vaughan |
Subject: |
[SCM] GNU M4 source repository branch, master, updated. cvs-readonly-349-gbef10cc |
Date: |
Tue, 09 Dec 2014 20:53:54 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU M4 source repository".
http://git.sv.gnu.org/gitweb/?p=m4.git;a=commitdiff;h=bef10ccba44e1689551324d68926444fce39b455
The branch, master has been updated
via bef10ccba44e1689551324d68926444fce39b455 (commit)
from fa1b673a452f5c7874cb5dd2610b5238cedc4d65 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bef10ccba44e1689551324d68926444fce39b455
Author: KO Myung-Hun <address@hidden>
Date: Tue Dec 9 20:46:11 2014 +0000
libm4: fix path_truncate() regressions on OS/2.
* m4/path.c (m4_path_search): Ensure that a null-terminator is
appended. Re-calculate a length of path after path_truncate().
Signed-off-by: Gary V. Vaughan <address@hidden>
-----------------------------------------------------------------------
Summary of changes:
m4/path.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/m4/path.c b/m4/path.c
index 8f57726..e2816cf 100644
--- a/m4/path.c
+++ b/m4/path.c
@@ -162,8 +162,6 @@ path_truncate (char *path)
return path;
}
-#else
-# define path_truncate(path) (path)
#endif
@@ -226,7 +224,11 @@ m4_path_search (m4 *context, const char *filename, const
char **suffixes)
size_t mem = strlen (filename);
/* Try appending each of the suffixes we were given. */
- filepath = path_truncate (strncpy (xmalloc (mem + max_suffix_len +1),
filename, mem));
+ filepath = strncpy (xmalloc (mem + max_suffix_len +1), filename, mem +1);
+#if FILE_TRUNCATE
+ filepath = path_truncate (filepath);
+ mem = strlen (filepath); /* recalculate length after truncation */
+#endif
for (i = 0; suffixes && suffixes[i]; ++i)
{
strcpy (filepath + mem, suffixes[i]);
@@ -267,9 +269,13 @@ m4_path_search (m4 *context, const char *filename, const
char **suffixes)
/* Capture errno only when searching `.'. */
e = errno;
- filepath = path_truncate (strncpy (xmalloc (mem + max_suffix_len +1),
pathname, mem));
+ filepath = strncpy (xmalloc (mem + max_suffix_len +1), pathname, mem +1);
free (pathname);
-
+#if FILE_TRUNCATE
+ filepath = path_truncate (filepath);
+ mem = strlen (filepath); /* recalculate length after truncation */
+#endif
+
for (i = 0; suffixes && suffixes[i]; ++i)
{
strcpy (filepath + mem, suffixes[i]);
hooks/post-receive
--
GNU M4 source repository
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU M4 source repository branch, master, updated. cvs-readonly-349-gbef10cc,
Gary V. Vaughan <=