From 868df451530c294cff3d4ccb98873626aa8105df Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 29 Jan 2015 21:31:14 +0200 Subject: [PATCH] Avoid compiler warnings in decode_env_path. src/emacs.c (decode_env_path): Add parentheses around ternary operator to increase readability and pacify compiler warnings. --- src/ChangeLog | 5 +++++ src/emacs.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 08779405acb..949ea741e1d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-01-29 Hans Wennborg (tiny change) + + * emacs.c (decode_env_path): Add parentheses around ternary + operator to increase readability and pacify compiler warnings. + 2015-01-29 Eli Zaretskii * w32.c (sys_readdir): Map ERROR_NOT_READY (as in "device not diff --git a/src/emacs.c b/src/emacs.c index 0b7adbd0967..9b78a70428e 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2300,7 +2300,7 @@ decode_env_path (const char *evarname, const char *defalt, bool empty) p = strchr (path, SEPCHAR); if (!p) p = path + strlen (path); - element = (p - path ? make_unibyte_string (path, p - path) + element = ((p - path) ? make_unibyte_string (path, p - path) : empty_element); if (! NILP (element)) { -- 2.39.2