Ticket #8906: os2fs_r2.diff

File os2fs_r2.diff, 1.3 KB (added by SF/lvzuufx, 16 years ago)

posix fs for OS/2 r2

  • backends/fs/posix/posix-fs.cpp

     
    6262                _path = p;
    6363        }
    6464       
     65#ifdef __OS2__
     66        // On OS/2, 'X:/' is a root of drive X, so we should not remove that last
     67        // slash.
     68        if (!(_path.size() == 3 && _path.hasSuffix(":/")))
     69#endif
    6570        // Normalize the path (that is, remove unneeded slashes etc.)
    6671        _path = Common::normalizePath(_path, '/');
    6772        _displayName = Common::lastPathComponent(_path, '/');
     
    97102        // We assume here that _path is already normalized (hence don't bother to call
    98103        //  Common::normalizePath on the final path).
    99104        Common::String newPath(_path);
    100         if (_path != "/")
     105        if (_path.lastChar() != '/')
    101106                newPath += '/';
    102107        newPath += n;
    103108
     
    117122       
    118123                for (int i = 0; i < 26; i++) {
    119124                        if (ulDrvMap & 1) {
    120                                 char *drive_root = "A:";
     125                                char drive_root[] = "A:/";
    121126                                drive_root[0] += i;
    122127       
    123128                POSIXFilesystemNode *entry = new POSIXFilesystemNode();
    124129                                entry->_isDirectory = true;
    125130                                entry->_isValid = true;
    126131                                entry->_path = drive_root;
    127                                 entry->_displayName = "[" + entry->_path + "]";
     132                                entry->_displayName = "[" + Common::String(drive_root, 2) + "]";
    128133                                myList.push_back(entry);
    129134                        }
    130135