Ticket #8528: check-dir.diff

File check-dir.diff, 690 bytes (added by SF/andrej4000, 18 years ago)
  • main.cpp

     
    168168        // We add it here, so MD5-based detection will be able to
    169169        // read mixed case files
    170170        if (ConfMan.hasKey("path")) {
    171                 if (!Common::File::exists(ConfMan.get("path"))) {
     171        char cur_dir[MAXPATHLEN];
     172        getcwd(cur_dir, MAXPATHLEN);
     173                if (chdir(ConfMan.get("path").c_str())) {
    172174                        warning("Game directory does not exist (%s)", ConfMan.get("path").c_str());
    173175                        return 0;
    174176                }
     177                chdir(cur_dir);
    175178                Common::File::addDefaultDirectory(ConfMan.get("path"));
    176179        } else {
    177180                Common::File::addDefaultDirectory(".");