summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 9a91aceb9..f7dccc01f 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -75,6 +75,7 @@ details. */
#include "shared_info.h"
#include "registry.h"
#include "cygtls.h"
+#include "environ.h"
#include <assert.h>
bool dos_file_warning = true;
@@ -1329,6 +1330,7 @@ conv_path_list (const char *src, char *dst, int to_posix)
int err = 0;
char *d = dst - 1;
+ bool saw_empty = false;
do
{
char *s = strccpy (srcbuf, &src, src_delim);
@@ -1343,7 +1345,11 @@ conv_path_list (const char *src, char *dst, int to_posix)
else if (!to_posix)
err = conv_fn (".", ++d);
else
- continue;
+ {
+ if (to_posix == ENV_CVT)
+ saw_empty = true;
+ continue;
+ }
if (err)
break;
d = strchr (d, '\0');
@@ -1351,6 +1357,9 @@ conv_path_list (const char *src, char *dst, int to_posix)
}
while (*src++);
+ if (saw_empty)
+ err = EIDRM;
+
if (d < dst)
d++;
*d = '\0';
@@ -3886,6 +3895,12 @@ cygwin_posix_to_win32_path_list_buf_size (const char *path_list)
}
extern "C" int
+env_win32_to_posix_path_list (const char *win32, char *posix)
+{
+ return_with_errno (conv_path_list (win32, posix, ENV_CVT));
+}
+
+extern "C" int
cygwin_win32_to_posix_path_list (const char *win32, char *posix)
{
return_with_errno (conv_path_list (win32, posix, 1));