summaryrefslogtreecommitdiff
path: root/lib/glob/glob.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2020-11-03 14:36:06 -0500
committerChet Ramey <chet.ramey@case.edu>2020-11-03 14:36:06 -0500
commit278db80c368700ed6117fbd390c89a9b44c0240c (patch)
treefbb2773da6da4b7b8d0516731e3b6d31c4ff8c53 /lib/glob/glob.c
parent5f2b5d79e0c0dd8f29e1d8e798675e33afbeda37 (diff)
downloadbash-278db80c368700ed6117fbd390c89a9b44c0240c.tar.gz
Bash-5.1-rc2 releasebash-5.1-rc2
Diffstat (limited to 'lib/glob/glob.c')
-rw-r--r--lib/glob/glob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/glob/glob.c b/lib/glob/glob.c
index c6f35933..eb6277f0 100644
--- a/lib/glob/glob.c
+++ b/lib/glob/glob.c
@@ -484,7 +484,7 @@ wdequote_pathname (pathname)
/* Convert the wide character string into unibyte character set. */
memset (&ps, '\0', sizeof(mbstate_t));
n = wcsrtombs(pathname, (const wchar_t **)&wpathname, len, &ps);
- if (n == (size_t)-1 || *wpathname != 0) /* what? now you tell me? */
+ if (n == (size_t)-1 || (wpathname && *wpathname != 0)) /* what? now you tell me? */
{
wpathname = orig_wpathname;
memset (&ps, '\0', sizeof(mbstate_t));