January 14, 2003 path.d, getExt | ||||
---|---|---|---|---|
| ||||
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 |
January 14, 2003 Re: path.d, getExt | ||||
---|---|---|---|---|
| ||||
Posted in reply to Yoram Harmelin | 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 |
Copyright © 1999-2021 by the D Language Foundation