From 2611889cb2aafe63c81cc1452a14f05c1f5ed90c Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Thu, 26 Mar 2009 16:28:57 +0100 Subject: [PATCH] Use the base directory in Unix globbing. --- mpdm_f.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/mpdm_f.c b/mpdm_f.c index c8b7153..8b4725c 100644 --- a/mpdm_f.c +++ b/mpdm_f.c @@ -1409,16 +1409,14 @@ mpdm_t mpdm_glob(const mpdm_t spec, const mpdm_t base) glob_t globbuf; const char *ptr; - /* convert to mbs */ - if (spec != NULL) { - mpdm_t sp = MPDM_2MBS(spec->data); + /* build full path */ + if (base != NULL) + v = mpdm_strcat(base, MPDM_LS(L"/")); - ptr = sp->data; - if (ptr == NULL || *ptr == '\0') - ptr = "*"; - } - else - ptr = "*"; + v = mpdm_strcat(v, mpdm_size(spec) == 0 ? MPDM_LS(L"*") : spec); + v = MPDM_2MBS(v->data); + + ptr = v->data; globbuf.gl_offs = 1; -- 2.11.4.GIT