david%upenn-dsl@CIS.UPENN.EDU (07/09/86)
Today I found a bug/feature in the UNIX file name parsing code. If it is given a null name, i.e. "", it returns the current directory. Now, it is quite obvious why it does this. But, it is not obvious that it should do this. I have written a routine that is to open a filename and do some stuff with the descriptor. The program user is to enter a line consisting of a command name and a file name. Well, if the user forgets the filename, WHAM, he gets a file full of garbage. To avoid this, I have to put in a check for null filenames, rather then letting the null name go to the routine that opens the file. I figured a null filename was invalid, so I figured this routine would barf at it through my controlled error detection. But NOOOOOOOOOOOOO. What do you think folks? Is this a bug or a feature? Dave Feldman