if (getintval2 (&tmpp2, &uci.highcyl, ',', false)) {
getintval (&tmpp2, &uci.pcyls, '/');
getintval (&tmpp2, &uci.pheads, '/');
- getintval2 (&tmpp2, &uci.psecs, '/', true);
+ getintval2 (&tmpp2, &uci.psecs, ',', true);
if (uci.pheads && uci.psecs) {
uci.physical_geometry = true;
} else {
uci.pheads = uci.psecs = uci.pcyls = 0;
uci.physical_geometry = false;
}
- if (tmpp2[0]) {
+ if (tmpp2 && tmpp2[0]) {
if (tmpp2[0] == '\"') {
n = cfgfile_unescape (tmpp2, &end, 0, false);
if (!n)
extern bool my_issamepath(const TCHAR *path1, const TCHAR *path2);
extern bool my_createsoftlink(const TCHAR *path, const TCHAR *target);
extern bool my_createshortcut(const TCHAR *source, const TCHAR *target, const TCHAR *description);
+extern void makesafefilename(TCHAR*, bool);
extern a_inode *custom_fsdb_lookup_aino_aname (a_inode *base, const TCHAR *aname);
extern a_inode *custom_fsdb_lookup_aino_nname (a_inode *base, const TCHAR *nname);
return p + 1;
return filename;
}
-
* 1632
*/
+void makesafefilename(TCHAR *s, bool evilonly)
+{
+ TCHAR *c;
+
+ for (int i = 0; i < NUM_EVILCHARS; i++)
+ while ((c = _tcschr(s, evilchars[i])) != 0)
+ *c = '_';
+
+ if (!evilonly) {
+ while ((c = _tcschr(s, '.')) != 0)
+ *c = '_';
+ while ((c = _tcschr(s, ' ')) != 0)
+ *c = '_';
+ }
+}
+
static TCHAR *make_uaefsdbpath (const TCHAR *dir, const TCHAR *name)
{
size_t len;
TCHAR *fsdb_create_unique_nname (a_inode *base, const TCHAR *suggestion)
{
- TCHAR *c;
TCHAR tmp[256] = UAEFSDB_BEGINS;
int i;
_tcsncat (tmp, suggestion, 240);
/* replace the evil ones... */
- for (i = 0; i < NUM_EVILCHARS; i++)
- while ((c = _tcschr (tmp, evilchars[i])) != 0)
- *c = '_';
-
- while ((c = _tcschr (tmp, '.')) != 0)
- *c = '_';
- while ((c = _tcschr (tmp, ' ')) != 0)
- *c = '_';
+ makesafefilename(tmp, false);
for (;;) {
TCHAR *p = build_nname (base->nname, tmp);
#include "memory.h"
#include "autoconf.h"
#include "rommgr.h"
+#include "fsdb.h"
#define hfd_log write_log
#define hfd_log2
_stprintf(geometry_file + _tcslen(geometry_file), _T(" %llX"), udi->size);
if (geometry_file[0])
_tcscat(geometry_file, _T(".geo"));
+ makesafefilename(geometry_file, true);
stringboxdialogactive = 1;
hdini = ini;