]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
cdimage0=. worked slightly differently than GUI eject and didn't eject the CD properl...
authorToni Wilen <twilen@winuae.net>
Tue, 28 Apr 2020 16:47:19 +0000 (19:47 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 28 Apr 2020 16:47:19 +0000 (19:47 +0300)
cfgfile.cpp

index 9db9526a9388155f27bbde71ab6130519d07f94f..3fc021e2d70f553e34d430eed6932ea8cd214340 100644 (file)
@@ -3195,16 +3195,17 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                                                *next2++ = 0;
                                        cfgfile_intval (option, next, tmp, &unitnum, 1);
                                }
-                               if (value[0] == 0 || !_tcsicmp(value, _T("empty")) || !_tcscmp(value, _T("."))) {
-                                       value[0] = 0;
-                                       p->cdslots[i].name[0] = 0;
-                               }
                                if (_tcslen (value) > 0) {
-                                       _tcsncpy (p->cdslots[i].name, value, sizeof p->cdslots[i].name / sizeof (TCHAR));
+                                       _tcsncpy (p->cdslots[i].name, value, sizeof(p->cdslots[i].name) / sizeof (TCHAR));
                                }
-                               p->cdslots[i].name[sizeof p->cdslots[i].name - 1] = 0;
+                               p->cdslots[i].name[sizeof(p->cdslots[i].name) / sizeof(TCHAR) - 1] = 0;
                                p->cdslots[i].inuse = true;
                                p->cdslots[i].type = type;
+                               if (value[0] == 0 || !_tcsicmp(value, _T("empty")) || !_tcscmp(value, _T("."))) {
+                                       value[0] = 0;
+                                       p->cdslots[i].name[0] = 0;
+                                       p->cdslots[i].inuse = false;
+                               }
                        }
                        // disable all following units
                        i++;