Skip to content

Commit

Permalink
convert(): warn when we cut off a path
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Feb 14, 2017
1 parent 7212cb8 commit c0e5eb3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions winsup/cygwin/msys2_path_conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ const char* convert(char *dst, size_t dstlen, const char *src) {
*dstit = '\0';
return dst;
}
*dstend = '\0';

const char* srcit = src;
const char* srcbeg = src;
Expand Down Expand Up @@ -555,6 +556,7 @@ void subp_convert(const char** from, const char* end, int is_url, char** dst, co
}

void ppl_convert(const char** from, const char* to, char** dst, const char* dstend) {
const char *orig_dst = *dst;
const char* it = *from;
const char* beg = it;
int prev_was_simc = 0;
Expand All @@ -579,8 +581,10 @@ void ppl_convert(const char** from, const char* to, char** dst, const char* dste
subp_convert(&beg, it, is_url, dst, dstend);
is_url = 0;

if (*dst == dstend)
break;
if (*dst == dstend) {
system_printf("Path cut off during conversion: %s\n", orig_dst);
break;
}

**dst = ';';
*dst += 1;
Expand Down

0 comments on commit c0e5eb3

Please sign in to comment.