[M3devel] Pathname.Legal

Olaf Wagner wagner at elegosoft.com
Sun Oct 14 16:28:11 CEST 2007


On Sun, Oct 14, 2007 at 12:24:48AM +0200, Neels Janosch Hofmeyr wrote:
> Hello all,
> 
> I encountered the problem that, in my cm3 compile,
> FS.GetAbsolutePathname cannot handle special characters in file names.
> As soon as a file contains a special character (ä, ß, ø, ...), a
> Pathname.Invalid exception is raised.
> 
> This happens because PathnamePosix.m3 has a list of legal characters:
> 
>   CONST Legal = SET OF CHAR {'\001' .. '\177'} - SET OF CHAR {DirSepChar};
> 
> which is enforced in Pathname.Compose and Pathname.ParsePosixPathname.
> 
> Pathname.Legal contains the complete ASCII list -- but no more than
> that. This means that characters like ä are considered illegal characters.
> 
> I reversed the Legal list to an Illegal list like this:
> 
>   CONST Illegal = SET OF CHAR {DirSepChar};
> 
> and also reversed the IF logic, replacing Legal with Illegal. This way
> all characters are allowed, except the DirSepChar. And voila, it works.
> PathnamePosix.m3 accepts weird filenames.
> 
> So, should this fix be applied to cm3?

Please commit the fix; I see no harm in allowing more characters
in pathnames than ASCII.

May this also be the cause for the problem encountered with CVSup's
directory creation? Probably not, but I don't remember exactly
why it went wrong.

Olaf

-- 
Olaf Wagner -- elego Software Solutions GmbH
               Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
   http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194



More information about the M3devel mailing list