From: Toni Wilen Date: Tue, 28 Apr 2020 16:47:19 +0000 (+0300) Subject: cdimage0=. worked slightly differently than GUI eject and didn't eject the CD properl... X-Git-Tag: 4400~62 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=93bb347cd2ecd6dc8e514781aa51fef40e1794f6;p=francis%2Fwinuae.git cdimage0=. worked slightly differently than GUI eject and didn't eject the CD properly in all situations. --- diff --git a/cfgfile.cpp b/cfgfile.cpp index 9db9526a..3fc021e2 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -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++;