www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1694] New: Zip::ArchiveMember::name format bug

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1694

           Summary: Zip::ArchiveMember::name format bug
           Product: D
           Version: 2.008
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: wqeqweuqy hotmail.com


ArchiveMember class in the Zip package is storing file names as formatted
arrays of ascii numbers. 

Kinda a trivial bug, but whatever heh.

example:

        foreach (ArchiveMember am; directory)
        {
            .printf("%s", "name: ");
            foreach (char c; am.name)
                .printf(" %c ", c);      
            .printf("%s", "\n");
        }

name: [  1  1  5  ,  1  0  1  ,  1  1  6  ,  1  1  6  ,  1  0  5  ,
1  1  0  ,  1  0  3  ,  1  1  5  ,  4  6  ,  1  0  5  ,  1  1  0  ,  1  0  5  ]


-- 
Nov 25 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1694







looks like this cast is whats breaking it:
de.name = to!(string) (data[i .. i + namelen]);

this fixes it:
de.name = cast(invariant(char)[]) data[i .. i + namelen];


-- 
Nov 25 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1694


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 2.009


-- 
Jan 02 2008