[LLVMdev] Win32/Path.cpp - isValid method has a bug

Jeff Cohen jeffc at jolt-lang.org
Thu Jan 13 20:09:00 PST 2005


Well, technically speaking, I am following the rules as defined in the 
MSDN Library.  Too bad those rules ignore the existance of "." and ".." :(

Anyway, fixed.

Henrik Bach wrote:

> Hi,
>
> I think the Win32/Path.cpp - especially method isValid has a bug:
> -----------------
> ...
>  // A file or directory name may not end in a period.
>  if (path[len-1] == '.')
>    return false;
>  if (len >= 2 && path[len-2] == '.' && path[len-1] == '/')
>    return false;
> ...
> -----------------
>
> This is valid on windows cmd prompt: 'dir \.' (root dir) and 'dir .\' 
> (current dir). This behavior is missing in above method.
>
> Henrik.
>
>
> =============================================================
> Henrik Bach
> LLVM Open Source Developer
>
> e-mail: henrik_bach_llvm at hotmail.com
> =============================================================
> 'Nothing is impossible; The impossible just takes longer time :)' - 
> Inventor of a new energy saver light bulp from Denmark.
>
> No software patents - Thank you Poland: 
> http://www.nosoftwarepatents.com/en/m/intro/app0411.html
> Got Freedom?
> Software Freedom Day - 28th of August
> http://www.softwarefreedomday.org/
> =============================================================
>
> _________________________________________________________________
> Del din verden med MSN Spaces http://spaces.msn.com
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list