www.digitalmars.com         C & C++   DMDScript  

D - path.d, getExt

reply Yoram Harmelin <yoram.harmelin ema.fr> writes:
I just noticed something happening with the:
  	char[] getExt(char[] fullname)
function, defined in path.d (Strip the old extension off and add the new 
one).

When passing a string without a coma ('.') in it, will return the given 
string, as if it was the extension. Shouldn't it be considered as the 
filename?

For example, let's say I have a program taking a file name as a 
parameter, to launch the program (let's call it test), I could type:
	test blah.txt

and the getExt function would return 'txt'.

But if I launch the program with:
	test blah

Then the getExt will return blah (thus considering that the string 
"blah" is an empty filename, with the extension blah (it won't even 
notice that it can't be an extension, as the 1st character is not a coma)).

Could someone tell me if it's the normal behaviour, please?

Y. Harmelin
Jan 14 2003
parent Evan McClanahan <evan dontSPAMaltarinteractive.com> writes:
Yoram Harmelin wrote:
 I just noticed something happening with the:
<snip>
 Could someone tell me if it's the normal behaviour, please?
 
 Y. Harmelin
 
likely just a bug. The library is still a bit immature at this point. Evan
Jan 14 2003