From e088f894144198abdbf58bf41a5e7a6b6499fda6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 15 Dec 2013 19:52:14 +0200 Subject: [PATCH] Minor fix in Windows-specific code in decode_env_path. src/emacs.c (decode_env_path): Fix bogus comparison against emacs_dir. Reported by Juanma Barranquero . --- src/ChangeLog | 5 +++++ src/emacs.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1b19a309c04..da3b78e0f25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-12-15 Eli Zaretskii + + * emacs.c (decode_env_path): Fix bogus comparison against + emacs_dir. Reported by Juanma Barranquero . + 2013-12-15 Juanma Barranquero * w32fns.c (Fw32_shell_execute): Remove unused local variable. diff --git a/src/emacs.c b/src/emacs.c index 9c5a33d5a89..2dfd12eff8b 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2224,7 +2224,8 @@ decode_env_path (const char *evarname, const char *defalt, bool empty) /* egetenv looks in process-environment, which holds the variables in their original system-locale encoding. We need emacs_dir to be in UTF-8. */ - filename_from_ansi (edir, emacs_dir); + if (edir) + filename_from_ansi (edir, emacs_dir); #endif /* It's okay to use getenv here, because this function is only used @@ -2299,7 +2300,7 @@ decode_env_path (const char *evarname, const char *defalt, bool empty) #ifdef WINDOWSNT /* Relative file names in the default path are interpreted as being relative to $emacs_dir. */ - if (emacs_dir && defaulted + if (edir && defaulted && strncmp (path, emacs_dir_env, emacs_dir_len) == 0) element = Fexpand_file_name (Fsubstring (element, -- 2.39.2