From: Miklos S. <mi...@sz...> - 2005-02-10 17:08:55
|
> If you mean to do this test outside parse_path than I think this should > be also okay. > Something like this (pseudocode) could work: > > name = ps->path > for(;;) { > while ( *name && *name != '#' ) name++; > while ( *name && *name != '/' ) name++; > *name = 0; > if ( lstat( name ) != 0 ) > break; > } > initial_seglen = name - ps->path; > return parse_path( ps, initial_seglen ) > > But on the other hand I don't see any benefit from this solution. It's simpler, which is a great benifit :) > Also my code can be extented to allow for supporting files > containing # inside archives if the lstat of the corresponding avfs > struct is used (ps->mnt->avfs->lstat()?). Inside archives the escaping will work. I agree that escaping has it's drawbacks, on the other hand # is not a very often used charater in filenames (I know emacs and CVS use it for intrenal purposes). Thanks, Miklos |