]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Path update, only resolve shortcuts when resolving path for use. Do not resolve symbo...
authorToni Wilen <twilen@winuae.net>
Thu, 12 Jul 2018 18:25:15 +0000 (21:25 +0300)
committerToni Wilen <twilen@winuae.net>
Thu, 12 Jul 2018 18:25:15 +0000 (21:25 +0300)
19 files changed:
akiko.cpp
arcadia.cpp
audio.cpp
blkdev.cpp
blkdev_cdimage.cpp
cdtv.cpp
cdtvcr.cpp
cfgfile.cpp
cia.cpp
disk.cpp
filesys.cpp
hardfile.cpp
include/fsdb.h
include/options.h
od-win32/fsdb_mywin32.cpp
od-win32/fsdb_win32.cpp
od-win32/win32gui.cpp
scsitape.cpp
x86.cpp

index d916c76d9b81b3fa80a6f45015ad7d339d62a50b..c03211a9f1767a7618115112f18ca61377a011c8 100644 (file)
--- a/akiko.cpp
+++ b/akiko.cpp
@@ -87,7 +87,7 @@ static void nvram_read (void)
                cubo_nvram = cd32_nvram + currprefs.cs_cd32nvram_size;
        }
        TCHAR path[MAX_DPATH];
-       cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
        cd32_flashfile = zfile_fopen (path, _T("rb+"), ZFD_NORMAL);
        if (!cd32_flashfile)
                cd32_flashfile = zfile_fopen (path, _T("wb"), 0);
index 82cff02ace0b10f094b31814923ef825fc787f5c..5437820a1685114308cb1a55f1e8e7713277f17d 100644 (file)
@@ -450,7 +450,7 @@ int is_arcadia_rom (const TCHAR *path)
 static void nvram_write (void)
 {
        TCHAR path[MAX_DPATH];
-       cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
        struct zfile *f = zfile_fopen (path, _T("rb+"), ZFD_NORMAL);
        if (!f) {
                f = zfile_fopen (path, _T("wb"), 0);
@@ -466,7 +466,7 @@ static void nvram_read (void)
        struct zfile *f;
 
        TCHAR path[MAX_DPATH];
-       cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
        f = zfile_fopen (path, _T("rb"), ZFD_NORMAL);
        memset (arbmemory + nvram_offset, 0, NVRAM_SIZE);
        if (!f)
@@ -600,7 +600,7 @@ static int algmemory_initialized;
 static void alg_nvram_write (void)
 {
        TCHAR path[MAX_DPATH];
-       cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
        struct zfile *f = zfile_fopen (path, _T("rb+"), ZFD_NORMAL);
        if (!f) {
                f = zfile_fopen (path, _T("wb"), 0);
@@ -616,7 +616,7 @@ static void alg_nvram_read (void)
        struct zfile *f;
 
        TCHAR path[MAX_DPATH];
-       cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
        f = zfile_fopen (path, _T("rb"), ZFD_NORMAL);
        memset (algmemory, 0, ALG_NVRAM_SIZE);
        if (!f)
index e700e60282368910ea52ffec49403261eeddcd9a..8f737cdcc76f13aabe808aade065d068d5b89c54 100644 (file)
--- a/audio.cpp
+++ b/audio.cpp
@@ -242,7 +242,7 @@ void audio_sampleripper (int mode)
                        if (!name[0])
                                underline[0] = 0;
                        if (type >= 0)
-                               cfgfile_resolve_path(name, sizeof(name) / sizeof(TCHAR), type);
+                               cfgfile_resolve_path_load(name, sizeof(name) / sizeof(TCHAR), type);
                        namesplit (name);
                        _tcscpy (extension, _T("wav"));
                        _stprintf (filename, _T("%s%s%s%03d.%s"), path, name, underline, cnt, extension);
index 6c8d0e796b343b4b5dd6d12a1779e8006fe09c9c..d76c7a0f975d32d56f281698232e2a484e8fbb5d 100644 (file)
@@ -418,7 +418,7 @@ static void cd_statusline_label(int unitnum)
        if (p[0]) {
                TCHAR name[MAX_DPATH];
                struct device_info di;
-               cfgfile_resolve_path_out(p, name, sizeof(name) / sizeof(TCHAR), PATH_CD);
+               cfgfile_resolve_path_out_load(p, name, sizeof(name) / sizeof(TCHAR), PATH_CD);
                const TCHAR *fname = my_getfilepart(name);
                if (sys_command_info(unitnum, &di, 0) && di.volume_id[0])
                        statusline_add_message(STATUSTYPE_CD, _T("CD%d: [%s] %s"), unitnum, di.volume_id, fname);
index ae5a62e6362824c550d4ea7d2270e5a6adfd4a65..fd4dba16a235ce923b4167765e12060294b20f41 100644 (file)
@@ -2233,7 +2233,7 @@ static int open_device (int unitnum, const TCHAR *ident, int flags)
                cdu->imgname_in[0] = 0;
                if (ident) {
                        _tcscpy(cdu->imgname_in, ident);
-                       cfgfile_resolve_path_out(cdu->imgname_in, cdu->imgname_out, MAX_DPATH, PATH_CD);
+                       cfgfile_resolve_path_out_load(cdu->imgname_in, cdu->imgname_out, MAX_DPATH, PATH_CD);
                }
                parse_image (cdu, ident);
                cdu->open = true;
index a4f03894704098a7fceb2b3c348fee7f37b26f36..f019aa8647b93e3743aff2e2edb94ac477f1da37 100644 (file)
--- a/cdtv.cpp
+++ b/cdtv.cpp
@@ -1543,7 +1543,7 @@ static void cdtv_loadcardmem (uae_u8 *p, int size)
        if (!size)
                return;
        memset (p, 0, size);
-       cfgfile_resolve_path_out(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
        f = zfile_fopen (flashfilepath, _T("rb"), ZFD_NORMAL);
        if (!f)
                return;
@@ -1558,7 +1558,7 @@ static void cdtv_savecardmem (uae_u8 *p, int size)
 
        if (!size)
                return;
-       cfgfile_resolve_path_out(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
        f = zfile_fopen (flashfilepath, _T("rb+"), ZFD_NORMAL);
        if (!f)
                return;
@@ -1573,7 +1573,7 @@ static void cdtv_battram_reset (void)
        int v;
 
        memset (cdtv_battram, 0, CDTV_NVRAM_SIZE);
-       cfgfile_resolve_path_out(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
        f = zfile_fopen (flashfilepath, _T("rb+"), ZFD_NORMAL);
        if (!f) {
                f = zfile_fopen (flashfilepath, _T("wb"), 0);
index 5d91be72059a4bf063c65bd878fe545d4c44122b..22d3aff0879fb9c4533867c2ea78cde786f32252 100644 (file)
@@ -110,7 +110,7 @@ static void cdtvcr_battram_reset (void)
        int v;
 
        memset (cdtvcr_ram, 0, CDTVCR_RAM_SIZE);
-       cfgfile_resolve_path_out(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.flashfile, flashfilepath, MAX_DPATH, PATH_ROM);
        f = zfile_fopen (flashfilepath, _T("rb+"), ZFD_NORMAL);
        if (!f) {
                f = zfile_fopen (flashfilepath, _T("wb"), 0);
index 651d8fe6b2602a6f9e3ceb4654f0848d39cf997c..e3c4520a69a758d3c37dfeaef502073812c3b20c 100644 (file)
@@ -916,12 +916,12 @@ static void cfgfile_write_rom (struct zfile *f, struct multipath *mp, const TCHA
 
 }
 
-static void cfgfile_to_path(const TCHAR *in, TCHAR *out, int type)
+static void cfgfile_to_path_save(const TCHAR *in, TCHAR *out, int type)
 {
        if (_tcschr(in, '%')) {
                _tcscpy(out, in);
        } else {
-               cfgfile_resolve_path_out(in, out, MAX_DPATH, type);
+               cfgfile_resolve_path_out_save(in, out, MAX_DPATH, type);
        }
 }
 
@@ -931,7 +931,7 @@ static void cfgfile_write_path2(struct zfile *f, const TCHAR *option, const TCHA
                cfgfile_write_str(f, option, value);
        } else {
                TCHAR path[MAX_DPATH];
-               cfgfile_resolve_path_out(value, path, MAX_DPATH, type);
+               cfgfile_resolve_path_out_save(value, path, MAX_DPATH, type);
                cfgfile_write_str(f, option, path);
        }
 }
@@ -941,7 +941,7 @@ static void cfgfile_dwrite_path2(struct zfile *f, const TCHAR *option, const TCH
                cfgfile_dwrite_str(f, option, value);
        } else {
                TCHAR path[MAX_DPATH];
-               cfgfile_resolve_path_out(value, path, MAX_DPATH, type);
+               cfgfile_resolve_path_out_save(value, path, MAX_DPATH, type);
                cfgfile_dwrite_str(f, option, path);
        }
 }
@@ -1007,7 +1007,7 @@ static void cfgfile_adjust_path(TCHAR *path, int maxsz, struct multipath *mp)
        xfree(s);
 }
 
-void cfgfile_resolve_path_out(const TCHAR *path, TCHAR *out, int size, int type)
+static void cfgfile_resolve_path_out_all(const TCHAR *path, TCHAR *out, int size, int type, bool save)
 {
        struct uae_prefs *p = &currprefs;
        TCHAR *s = NULL;
@@ -1037,12 +1037,26 @@ void cfgfile_resolve_path_out(const TCHAR *path, TCHAR *out, int size, int type)
                _tcscpy(out, s);
                xfree(s);
        }
-       my_resolvesoftlink(out, size);
+       if (!save) {
+               my_resolvesoftlink(out, size, true);
+       }
 }
 
-void cfgfile_resolve_path(TCHAR *path, int size, int type)
+void cfgfile_resolve_path_out_load(const TCHAR *path, TCHAR *out, int size, int type)
+{
+       cfgfile_resolve_path_out_all(path, out, size, type, false);
+}
+void cfgfile_resolve_path_load(TCHAR *path, int size, int type)
+{
+       cfgfile_resolve_path_out_all(path, path, size, type, false);
+}
+void cfgfile_resolve_path_out_save(const TCHAR *path, TCHAR *out, int size, int type)
+{
+       cfgfile_resolve_path_out_all(path, out, size, type, true);
+}
+void cfgfile_resolve_path_save(TCHAR *path, int size, int type)
 {
-       cfgfile_resolve_path_out(path, path, size, type);
+       cfgfile_resolve_path_out_all(path, path, size, type, true);
 }
 
 
@@ -1071,7 +1085,7 @@ static void write_filesys_config (struct uae_prefs *p, struct zfile *f)
                                        *ptr = 0;
                        }
                } else {
-                       cfgfile_to_path(ci->rootdir, str1, ci->type == UAEDEV_DIR ? PATH_DIR : (ci->type == UAEDEV_CD ? PATH_CD : (ci->type == UAEDEV_HDF ? PATH_HDF : PATH_TAPE)));
+                       cfgfile_to_path_save(ci->rootdir, str1, ci->type == UAEDEV_DIR ? PATH_DIR : (ci->type == UAEDEV_CD ? PATH_CD : (ci->type == UAEDEV_HDF ? PATH_HDF : PATH_TAPE)));
                }
                int ct = ci->controller_type;
                int romtype = 0;
@@ -1119,7 +1133,7 @@ static void write_filesys_config (struct uae_prefs *p, struct zfile *f)
 #endif
                } else if (ci->type == UAEDEV_HDF || ci->type == UAEDEV_CD || ci->type == UAEDEV_TAPE) {
                        TCHAR filesyspath[MAX_DPATH];
-                       cfgfile_to_path(ci->filesys, filesyspath, PATH_HDF);
+                       cfgfile_to_path_save(ci->filesys, filesyspath, PATH_HDF);
                        TCHAR *sfilesys = cfgfile_escape_min(filesyspath);
                        TCHAR *sgeometry = cfgfile_escape(ci->geometry, NULL, true);
                        _stprintf (tmp, _T("%s,%s:%s,%d,%d,%d,%d,%d,%s,%s"),
@@ -1755,7 +1769,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
                if (p->cdslots[i].name[0] || p->cdslots[i].inuse) {
                        TCHAR tmp2[MAX_DPATH];
                        _stprintf (tmp, _T("cdimage%d"), i);
-                       cfgfile_to_path(p->cdslots[i].name, tmp2, PATH_CD);
+                       cfgfile_to_path_save(p->cdslots[i].name, tmp2, PATH_CD);
                        if (p->cdslots[i].type != SCSI_UNIT_DEFAULT || _tcschr (p->cdslots[i].name, ',') || p->cdslots[i].delayed) {
                                _tcscat (tmp2, _T(","));
                                if (p->cdslots[i].delayed) {
@@ -4324,7 +4338,7 @@ static bool parse_geo (const TCHAR *tname, struct uaedev_config_info *uci, struc
        bool ret = false;
        TCHAR tgname[MAX_DPATH];
 
-       cfgfile_resolve_path_out(tname, tgname, MAX_DPATH, PATH_HDF);
+       cfgfile_resolve_path_out_load(tname, tgname, MAX_DPATH, PATH_HDF);
        ini = ini_load(tgname);
        if (!ini)
                return ret;
@@ -6288,7 +6302,7 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real
                                cfgfile_string (line1b, line2b, _T("config_window_title"), p->config_window_title, sizeof p->config_window_title / sizeof (TCHAR));
                                // boxart checks
                                cfgfile_string(line1b, line2b, _T("floppy0"), p->floppyslots[0].df, sizeof p->floppyslots[0].df / sizeof(TCHAR));
-                               cfgfile_resolve_path(p->floppyslots[0].df, MAX_DPATH, PATH_FLOPPY);
+                               cfgfile_resolve_path_load(p->floppyslots[0].df, MAX_DPATH, PATH_FLOPPY);
                                TCHAR tmp[MAX_DPATH];
                                if (!p->mountitems && (cfgfile_string(line1b, line2b, _T("hardfile2"), tmp, sizeof tmp / sizeof(TCHAR)) || cfgfile_string(line1b, line2b, _T("filesystem2"), tmp, sizeof tmp / sizeof(TCHAR)))) {
                                        const TCHAR *s = _tcschr(tmp, ':');
@@ -6310,7 +6324,7 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real
                                                        if (se) {
                                                                tmp[se - tmp] = 0;
                                                                _tcscpy(p->mountconfig[0].ci.rootdir, s);
-                                                               cfgfile_resolve_path(p->mountconfig[0].ci.rootdir, MAX_DPATH, isvsys ? PATH_DIR : PATH_HDF);
+                                                               cfgfile_resolve_path_load(p->mountconfig[0].ci.rootdir, MAX_DPATH, isvsys ? PATH_DIR : PATH_HDF);
                                                                p->mountitems = 1;
                                                        }
                                                }
@@ -6329,7 +6343,7 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real
                                                        tmp[se - tmp] = 0;
                                        }
                                        _tcscpy(p->cdslots[0].name, s);
-                                       cfgfile_resolve_path(p->cdslots[0].name, MAX_DPATH, PATH_CD);
+                                       cfgfile_resolve_path_load(p->cdslots[0].name, MAX_DPATH, PATH_CD);
                                        p->cdslots[0].inuse = 1;
                                }
                        }
diff --git a/cia.cpp b/cia.cpp
index fff9d29f25da06145ce2dc9d54a7a287f0229929..57caa61ea4600102cf11883ebe53df2872fb4118 100644 (file)
--- a/cia.cpp
+++ b/cia.cpp
@@ -2174,7 +2174,7 @@ static void write_battclock (void)
        if (!currprefs.rtcfile[0] || currprefs.cs_rtc == 0)
                return;
        TCHAR path[MAX_DPATH];
-       cfgfile_resolve_path_out(currprefs.rtcfile, path, MAX_DPATH, PATH_ROM);
+       cfgfile_resolve_path_out_load(currprefs.rtcfile, path, MAX_DPATH, PATH_ROM);
        struct zfile *f = zfile_fopen (path, _T("wb"));
        if (f) {
                struct tm *ct;
@@ -2231,7 +2231,7 @@ void rtc_hardreset (void)
        }
        if (currprefs.rtcfile[0]) {
                TCHAR path[MAX_DPATH];
-               cfgfile_resolve_path_out(currprefs.rtcfile, path, MAX_DPATH, PATH_ROM);
+               cfgfile_resolve_path_out_load(currprefs.rtcfile, path, MAX_DPATH, PATH_ROM);
                struct zfile *f = zfile_fopen (path, _T("rb"));
                if (f) {
                        uae_u8 empty[13];
index 88ed715f958c38c099f2668d253dcb44029c9118..8a2373f03c7c6796dbd7fb340a6916d9b6797030 100644 (file)
--- a/disk.cpp
+++ b/disk.cpp
@@ -770,7 +770,7 @@ int DISK_validate_filename (struct uae_prefs *p, const TCHAR *fname_in, TCHAR *o
        if (wrprot)
                *wrprot = p->floppy_read_only ? 1 : 0;
 
-       cfgfile_resolve_path_out(fname_in, outname, MAX_DPATH, PATH_FLOPPY);
+       cfgfile_resolve_path_out_load(fname_in, outname, MAX_DPATH, PATH_FLOPPY);
        if (outfname)
                _tcscpy(outfname, outname);
 
index 6296ffdd63d62d8f87458985e0a8b37499977d45..75b16923ee748e7cc4bc105a521c18181ad1d638 100644 (file)
@@ -334,7 +334,7 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo *
        if (!ui) {
                ui = &uitmp;
                if (uci->ci.type == UAEDEV_DIR) {
-                       cfgfile_resolve_path_out(uci->ci.rootdir, filepath, MAX_DPATH, PATH_DIR);
+                       cfgfile_resolve_path_out_load(uci->ci.rootdir, filepath, MAX_DPATH, PATH_DIR);
                        _tcscpy(mi->rootdir, filepath);
                        mi->ismounted = 1;
                        if (filepath[0] == 0)
@@ -348,7 +348,7 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo *
                        mi->ismedia = true;
                        return FILESYS_VIRTUAL;
                } else if (uci->ci.type == UAEDEV_HDF) {
-                       cfgfile_resolve_path_out(uci->ci.rootdir, filepath, MAX_DPATH, PATH_HDF);
+                       cfgfile_resolve_path_out_load(uci->ci.rootdir, filepath, MAX_DPATH, PATH_HDF);
                        _tcscpy(mi->rootdir, filepath);
                        ui->hf.ci.readonly = true;
                        ui->hf.ci.blocksize = uci->ci.blocksize;
@@ -369,7 +369,7 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo *
                                mi->ismedia = 0;
                        hdf_close (&ui->hf);
                } else if (uci->ci.type == UAEDEV_CD) {
-                       cfgfile_resolve_path_out(uci->ci.rootdir, filepath, MAX_DPATH, PATH_CD);
+                       cfgfile_resolve_path_out_load(uci->ci.rootdir, filepath, MAX_DPATH, PATH_CD);
                        _tcscpy(mi->rootdir, filepath);
                        struct device_info di;
                        ui->hf.ci.readonly = true;
@@ -397,7 +397,7 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo *
                }
        }
        if (uci->ci.type == UAEDEV_TAPE) {
-               cfgfile_resolve_path_out(uci->ci.rootdir, filepath, MAX_DPATH, PATH_TAPE);
+               cfgfile_resolve_path_out_load(uci->ci.rootdir, filepath, MAX_DPATH, PATH_TAPE);
                _tcscpy(mi->rootdir, filepath);
                struct device_info di;
                int unitnum = getuindex (p, index);
@@ -506,7 +506,7 @@ TCHAR *filesys_createvolname (const TCHAR *volname, const TCHAR *rootdir, struct
        TCHAR *p = NULL;
        TCHAR path[MAX_DPATH];
 
-       cfgfile_resolve_path_out(rootdir, path, MAX_DPATH, PATH_DIR);
+       cfgfile_resolve_path_out_load(rootdir, path, MAX_DPATH, PATH_DIR);
 
        archivehd = -1;
        if (my_existsfile (path))
@@ -701,7 +701,7 @@ static int set_filesys_unit_1 (int nr, struct uaedev_config_info *ci, bool custo
        iscd = nr >= cd_unit_offset && nr < cd_unit_offset + cd_unit_number;
 
        if (!custom)
-               cfgfile_resolve_path(c.rootdir, MAX_DPATH, iscd ? PATH_CD : (ci->volname[0] ? PATH_DIR : PATH_HDF));
+               cfgfile_resolve_path_load(c.rootdir, MAX_DPATH, iscd ? PATH_CD : (ci->volname[0] ? PATH_DIR : PATH_HDF));
 
        for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
                if (nr == i || !mountinfo.ui[i].open || mountinfo.ui[i].rootdir == NULL || is_hardfile (i) == FILESYS_CD)
@@ -2747,7 +2747,7 @@ static int fill_file_attrs (Unit *u, a_inode *base, a_inode *c)
 static int test_softlink (a_inode *aino)
 {
        int err;
-       if (aino->softlink && my_resolvesoftlink (aino->nname, -1))
+       if (aino->softlink && my_resolvesoftlink (aino->nname, -1, false))
                err = ERROR_IS_SOFT_LINK;
        else
                err = ERROR_OBJECT_NOT_AROUND;
@@ -3915,7 +3915,7 @@ static void action_read_link(TrapContext *ctx, Unit *unit, dpacket *packet)
        }
        _tcscpy (tmp, a->nname);
        write_log (_T("Resolving softlink '%s'\n"), tmp);
-       if (!my_resolvesoftlink (tmp, sizeof tmp / sizeof (TCHAR))) {
+       if (!my_resolvesoftlink (tmp, sizeof tmp / sizeof (TCHAR), false)) {
                xfree(extrapath);
                PUT_PCK_RES1 (packet, DOS_FALSE);
                //  not sure what to return
@@ -8641,7 +8641,7 @@ static int dofakefilesys (TrapContext *ctx, UnitInfo *uip, uaecptr parmpacket, s
 
        tmp[0] = 0;
        if (uip->filesysdir && _tcslen (uip->filesysdir) > 0) {
-               cfgfile_resolve_path_out(uip->filesysdir, tmp, MAX_DPATH, PATH_HDF);
+               cfgfile_resolve_path_out_load(uip->filesysdir, tmp, MAX_DPATH, PATH_HDF);
        } else if ((dostype & 0xffffff00) == DISK_TYPE_DOS) {
                _tcscpy (tmp, currprefs.romfile);
                int i = _tcslen (tmp);
index f695500751e46dd503fcdd556250f488bc0a6a3d..49c0300ae476aa3131d7d30e6a37a7db4e3a625f 100644 (file)
@@ -386,7 +386,7 @@ static void create_virtual_rdb (struct hardfiledata *hfd)
        if (hfd->ci.filesys[0]) {
                struct zfile *f = NULL;
                TCHAR fspath[MAX_DPATH];
-               cfgfile_resolve_path_out(hfd->ci.filesys, fspath, MAX_DPATH, PATH_HDF);
+               cfgfile_resolve_path_out_load(hfd->ci.filesys, fspath, MAX_DPATH, PATH_HDF);
                filesys = zfile_load_file(fspath, &filesyslen);
                if (filesys) {
                        fsver = get_filesys_version(filesys, filesyslen);
@@ -626,7 +626,7 @@ int hdf_open (struct hardfiledata *hfd, const TCHAR *pname)
        hfd->virtual_rdb = NULL;
        if (!pname)
                pname = hfd->ci.rootdir;
-       cfgfile_resolve_path_out(pname, filepath, MAX_DPATH, PATH_HDF);
+       cfgfile_resolve_path_out_load(pname, filepath, MAX_DPATH, PATH_HDF);
 #ifdef WITH_CHD
        TCHAR nametmp[MAX_DPATH];
        _tcscpy (nametmp, filepath);
index 9ab37d6ec87f842bde2eb47f8bfdae5784d59e26..a2797aec0e69b62f686658447cd0ac35a07fe6c5 100644 (file)
@@ -176,7 +176,7 @@ extern bool my_utime (const TCHAR *name, struct mytimeval *tv);
 extern bool my_chmod (const TCHAR *name, uae_u32 mode);
 extern bool my_resolveshortcut(TCHAR *linkfile, int size);
 extern bool my_resolvessymboliclink(TCHAR *linkfile, int size);
-extern bool my_resolvesoftlink(TCHAR *linkfile, int size);
+extern bool my_resolvesoftlink(TCHAR *linkfile, int size, bool linkonly);
 extern const TCHAR *my_getfilepart(const TCHAR *filename);
 extern void my_canonicalize_path(const TCHAR *path, TCHAR *out, int size);
 extern int my_issamevolume(const TCHAR *path1, const TCHAR *path2, TCHAR *path);
index 3a9b336f9ef26ef1791e76767aed58d80b5040ce..befb22c6614d1187053e81a3f954c9dc16689218 100644 (file)
@@ -913,8 +913,10 @@ extern void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type
 extern int target_get_display (const TCHAR*);
 extern const TCHAR *target_get_display_name (int, bool);
 extern void target_multipath_modified(struct uae_prefs *);
-extern void cfgfile_resolve_path_out(const TCHAR *path, TCHAR *out, int size, int type);
-extern void cfgfile_resolve_path(TCHAR *path, int size, int type);
+extern void cfgfile_resolve_path_out_load(const TCHAR *path, TCHAR *out, int size, int type);
+extern void cfgfile_resolve_path_load(TCHAR *path, int size, int type);
+extern void cfgfile_resolve_path_out_save(const TCHAR *path, TCHAR *out, int size, int type);
+extern void cfgfile_resolve_path_save(TCHAR *path, int size, int type);
 
 extern struct uae_prefs *cfgfile_open(const TCHAR *filename, int *type);
 extern void cfgfile_close(struct uae_prefs *p);
index b1b02c7a5db477c0ced387f1d171bf1e48568ed5..c96c68b27aa258f2e5834c67008e0b1f7e9ea024 100644 (file)
@@ -1003,13 +1003,15 @@ bool my_createshortcut(const TCHAR *source, const TCHAR *target, const TCHAR *de
 }
 
 
-bool my_resolvesoftlink(TCHAR *linkfile, int size)
+bool my_resolvesoftlink(TCHAR *linkfile, int size, bool linkonly)
 {
-       int v = my_resolvessymboliclink2(linkfile, size);
-       if (v > 0)
-               return true;
-       if (v == 0)
-               return false;
+       if (!linkonly) {
+               int v = my_resolvessymboliclink2(linkfile, size);
+               if (v > 0)
+                       return true;
+               if (v == 0)
+                       return false;
+       }
        if (my_resolveshortcut(linkfile,size))
                return true;
        return false;
index 634a6d0c39dbff5c17336fd90ff3fd107a58448f..407011fe9ad329ac004ad7734fa80f9d745771b8 100644 (file)
@@ -435,7 +435,7 @@ int fsdb_fill_file_attrs (a_inode *base, a_inode *aino)
                if (ext && !_tcsicmp (ext, _T(".lnk"))) {
                        TCHAR tmp[MAX_DPATH];
                        _tcscpy (tmp, aino->nname);
-                       if (my_resolvesoftlink (tmp, sizeof tmp / sizeof (TCHAR))) {
+                       if (my_resolvesoftlink (tmp, sizeof tmp / sizeof (TCHAR), false)) {
                                //write_log (_T("2 '%s'\n"), aino->nname);
                                ext = _tcsrchr (aino->aname, '.');
                                if (ext && !_tcsicmp (ext, _T(".lnk")))
index 64124ff064a9b8df18b74b89cf66b297bc0b5ed6..e7378ae83f66c1a22a3fdf0b9f6ed568e563a8f4 100644 (file)
@@ -20059,7 +20059,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage)
                int mask;
 
                DragQueryFile (hd, i, file, sizeof (file) / sizeof (TCHAR));
-               my_resolvesoftlink (file, sizeof file / sizeof (TCHAR));
+               my_resolvesoftlink (file, sizeof file / sizeof (TCHAR), true);
                filepart = _tcsrchr (file, '/');
                if (!filepart)
                        filepart = _tcsrchr (file, '\\');
index 21c7b36e675415c82ac0ba6c88477304791369f9..839a4d0611aea920b04bb16c17898be684caa38c 100644 (file)
@@ -64,7 +64,7 @@ static void tape_init (int unit, struct scsi_data_tape *tape, const TCHAR *tape_
        TCHAR tape_dir_path[MAX_DPATH];
 
        memset (tape, 0, sizeof (struct scsi_data_tape));
-       cfgfile_resolve_path_out(tape_directory, tape_dir_path, MAX_DPATH, PATH_TAPE);
+       cfgfile_resolve_path_out_load(tape_directory, tape_dir_path, MAX_DPATH, PATH_TAPE);
        _tcscpy(tape->tape_dir, tape_dir_path);
        path[0] = 0;
 
diff --git a/x86.cpp b/x86.cpp
index 7a76447e137f1177f017876b65b6149e64079a9b..56879b3aa04f2cc9b28712233853363b083976a1 100644 (file)
--- a/x86.cpp
+++ b/x86.cpp
@@ -3387,7 +3387,7 @@ bool x86_bridge_init(struct autoconfig_info *aci, uae_u32 romtype, int type)
                FPU_Init(dosbox_sec);
                if (xb->type >= TYPE_2286) {
                        TCHAR path[MAX_DPATH];
-                       cfgfile_resolve_path_out(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
+                       cfgfile_resolve_path_out_load(currprefs.flashfile, path, MAX_DPATH, PATH_ROM);
                        xb->cmossize = xb->type == TYPE_2386 ? 192 : 64;
                        xb->cmosfile = zfile_fopen(path, _T("rb+"), ZFD_NORMAL);
                        if (!xb->cmosfile) {