VOGONS


First post, by jal

User metadata
Rank Oldbie
Rank
Oldbie

A while ago I found a bug: when using the "dir .." command, the current dir was shown. Since then I got hold of a copy of VC.NET, and I found the bug. In the "ExpandDot" inline function (defined in shell.h), when args[0] equals '.' and args[1] equals either '.' or '\\', buffer isn't filled, and a random result is returned (the release build probably has 0's there, so the current dir is displayed as if just "dir" was typed). The solution is to add an else with a strcpy. The full function than becomes:

static inline char *ExpandDot (char *args, char *buffer)
{
if (args[0] == '.')
{
if (args[1] == 0)
{
strcpy (buffer, "*.*");
return buffer;
}

if (args[1] != '.' && args[1] != '\\')
{
buffer[0] = '*';
buffer[1] = 0;
strcat (buffer, args);
return buffer;
}
else // JAL_20040304
strcpy (buffer, args);
}
else
strcpy (buffer,args);

return buffer;
}

I have no idea how to contribute this to the CVS - maybe someone can explain?

JAL

Reply 2 of 3, by jal

User metadata
Rank Oldbie
Rank
Oldbie
mirekluza wrote:

Okay, thanx, found it, registered and added the patch...

JAL