From 71575d1a52c48ff83a6a367a498ed2805d3a5140 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 10 Oct 2006 03:00:55 +0000 Subject: [PATCH] * src/path.c (include_env_init): Copy the string returned by getenv before overwriting it; POSIX disallows this. --- ChangeLog | 5 +++++ src/path.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index daac0e28..08356467 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-10-09 Ralf Wildenhues + + * src/path.c (include_env_init): Copy the string returned + by getenv before overwriting it; POSIX disallows this. + 2006-10-09 Eric Blake * src/m4.c (main): Defer debugfile until after --help. diff --git a/src/path.c b/src/path.c index ca604142..3867c7d9 100644 --- a/src/path.c +++ b/src/path.c @@ -58,6 +58,7 @@ include_env_init (void) path = getenv ("M4PATH"); if (path == NULL) return; + path = xstrdup (path); do { @@ -68,6 +69,7 @@ include_env_init (void) path = path_end + 1; } while (path_end); + free (path); } void -- 2.11.4.GIT