|
|
| version 1.8, 2003/10/30 16:54:04 | version 1.9, 2003/10/30 22:33:34 |
|---|---|
| Line 459 static const INITBL iniitem[] = { | Line 459 static const INITBL iniitem[] = { |
| {"I286SAVE", INIRO_BOOL, &np2oscfg.I286SAVE, 0}}; | {"I286SAVE", INIRO_BOOL, &np2oscfg.I286SAVE, 0}}; |
| static void getinifile(char *initfile, int max) { | void initgetfile(char *path, UINT size) { |
| char *p; | char *p; |
| milstr_ncpy(initfile, modulefile, max); | file_cpyname(path, modulefile, size); |
| if (np2arg.ini) { | if (np2arg.ini) { |
| if ((np2arg.ini[0] == '/') || (np2arg.ini[0] == '-')) { | if ((np2arg.ini[0] == '/') || (np2arg.ini[0] == '-')) { |
| file_cutname(initfile); | file_cutname(path); |
| milstr_ncat(initfile, file_getname(np2arg.ini + 2), max); | file_catname(path, file_getname(np2arg.ini + 2), size); |
| } | } |
| else { | else { |
| milstr_ncpy(initfile, np2arg.ini, max); | file_cpyname(path, np2arg.ini, size); |
| } | } |
| p = file_getext(initfile); | p = file_getext(path); |
| if (!(*p)) { | if (!(*p)) { |
| milstr_ncat(initfile, ".ini", max); | file_catname(path, ".ini", size); |
| } | } |
| } | } |
| else { | else { |
| file_cutext(initfile); | file_cutext(path); |
| milstr_ncat(initfile, ".ini", max); | file_catname(path, ".ini", size); |
| } | } |
| } | } |
| Line 487 void initload(void) { | Line 487 void initload(void) { |
| char path[MAX_PATH]; | char path[MAX_PATH]; |
| getinifile(path, sizeof(path)); | initgetfile(path, sizeof(path)); |
| ini_read(path, ini_title, iniitem, sizeof(iniitem)/sizeof(INITBL)); | ini_read(path, ini_title, iniitem, sizeof(iniitem)/sizeof(INITBL)); |
| } | } |
| Line 495 void initsave(void) { | Line 495 void initsave(void) { |
| char path[MAX_PATH]; | char path[MAX_PATH]; |
| getinifile(path, sizeof(path)); | initgetfile(path, sizeof(path)); |
| ini_write(path, ini_title, iniitem, sizeof(iniitem)/sizeof(INITBL)); | ini_write(path, ini_title, iniitem, sizeof(iniitem)/sizeof(INITBL)); |
| } | } |