Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1919 (closed defect: invalid)

Opened 2 years ago

Last modified 2 years ago

'\' breaks PathParser

Reported by: DRK Assigned to: community
Priority: major Milestone: 1.0
Component: Tango Version: 0.99.9 Kai
Keywords: Cc:

Description

Example:

module test;

import tango.core.tools.TraceExceptions;
import tango.io.Path : PathParser;

void main()
{
    PathParser pp;
    pp.parse("a\\b");
}

Compiled with dmd -g test.d using DMD 1.057 + Tango 0.99.9. Throw the following on execution:

tango.core.Exception.IOException: unexpected '\' character in path: a\b
----------------
[  410268]       0+0   tango.core.tools.WinStackTrace.winAddrBacktrace
                        @0+57892 :0
[  4087dc]       0+0   tango.core.tools.StackTrace.defaultAddrBacktrace
                        @0+26520 :0
[  40884d]       0+0   tango.core.tools.StackTrace.basicTracer
                        @0+26633 :0
[  40815f]       0+0   tango.core.Exception.PlatformException._ctor
                        @0+24859 :0
[  408261]       0+0   tango.core.Exception.IOException._ctor
                        @0+25117 :0
[  402474]       0+0   tango.io.Path.FS.exception
                        @0+1072 :0
[  4028f4]       0+0   tango.io.Path.PathParser.parse
                        @0+2224 :0
[  402813]       0+0   tango.io.Path.PathParser.parse
                        @0+1999 :0
[  40203d]       0+0   __Dmain
                        @0+16 test.d:9
[  4023e5]       0+0   rt.compiler.dmd.rt.dmain2.main.runMain
                        @0+929 :0
[  40233b]       0+0   rt.compiler.dmd.rt.dmain2.main.tryExec
                        @0+759 :0
[  402423]       0+0   rt.compiler.dmd.rt.dmain2.main.runAll
                        @0+991 :0
[  40233b]       0+0   rt.compiler.dmd.rt.dmain2.main.tryExec
                        @0+759 :0
[  4022f3]       0+0   _main
                        @0+687 :0
[  418cec]       0+0   _mainCRTStartup
                        @0+93352 :0
[75b33675]       0+0   ???
                           @0+1970476593 :0
[77df9d70]       0+0   ???
                           @0+2006940972 :0
[77df9d40]       0+0   ???
                           @0+2006940924 :0

Change History

05/18/10 13:14:02 changed by DRK

  • status changed from new to closed.
  • resolution set to invalid.

Tango doesn't support '\' as a path separator. The input has to be sanitised by tango.io.Path.standard, and can be turned back into a native path with tango.io.Path.native.