1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eban 2000-09-25 13:39:58 +00:00
parent b617f5270c
commit ba2b829a0f

View file

@ -873,19 +873,18 @@ NtCmdGlob (NtCmdLineElement *patt)
{
ListInfo listinfo;
char buffer[MAXPATHLEN], *buf = buffer;
char *p, *pend, *pb;
char *p;
listinfo.head = listinfo.tail = 0;
if (patt->len >= MAXPATHLEN)
buf = ruby_xmalloc(patt->len + 1);
p = patt->str;
pend = p + patt->len;
pb = buf;
for (; p < pend; p = CharNext(p))
*pb++ = *p == '\\' ? '/' : *p;
buf[patt->len] = 0;
strncpy (buf, patt->str, patt->len);
buf[patt->len] = '\0';
for (p = buf; *p; p = CharNext(p))
if (*p == '\\')
*p = '/';
rb_glob(buf, insert, (VALUE)&listinfo);
if (buf != buffer)
free(buf);