Ticket #8906: os2fs.diff

File os2fs.diff, 1.7 KB (added by SF/lvzuufx, 16 years ago)

posix fs for OS/2

  • common/str.cpp

     
    550550        const char *cur = path.c_str();
    551551        Common::String result;
    552552
     553#ifdef __OS2__
     554    // If there is a drive letter, preserve that:
     555    if (cur[ 0 ] && cur[ 1 ] == ':')
     556    {
     557        result += cur[ 0 ];
     558        result += ':';
     559        cur += 2;
     560    }
     561#endif
     562
    553563        // If there is a leading slash, preserve that:
    554564        if (*cur == sep) {
    555565                result += sep;
  • backends/fs/posix/posix-fs.cpp

     
    124124                                drive_root[2] = '/';
    125125                                drive_root[3] = 0;
    126126       
    127                                 POSIXFilesystemNode entry;
     127                // Start with a clone of this node, with the correct path set
     128                POSIXFilesystemNode entry(*this);
    128129       
    129130                                entry._isDirectory = true;
    130131                                entry._isValid = true;
     
    161162                POSIXFilesystemNode entry(*this);
    162163                entry._displayName = dp->d_name;
    163164                if (_path != "/")
     165        #ifdef __OS2__
     166            if (!(_path.size() == 2 && _path.hasSuffix(":")) &&
     167                !(_path.size() == 3 && _path.hasSuffix(":/")))
     168        #endif
    164169                        entry._path += '/';
    165170                entry._path += entry._displayName;
    166171
     
    212217        if (_path == "/")
    213218                return 0;       // The filesystem root has no parent
    214219
     220#ifdef __OS2__
     221    if (_path.size() == 3 && _path.hasSuffix(":/"))
     222        // This is a root directory of a drive
     223        return makeNode("/");   // return a virtual root for a list of drives
     224#endif
     225
    215226        const char *start = _path.c_str();
    216227        const char *end = start + _path.size();
    217228