fix search in registry.
This commit is contained in:
parent
edb982cfff
commit
0ee26c6df9
12
C/save.c
Normal file → Executable file
12
C/save.c
Normal file → Executable file
@ -1447,9 +1447,6 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
|
|||||||
save_buffer[0] = '\0';
|
save_buffer[0] = '\0';
|
||||||
// LOCAL_ErrorMessage = NULL;
|
// LOCAL_ErrorMessage = NULL;
|
||||||
if (inpf == NULL) {
|
if (inpf == NULL) {
|
||||||
#if _MSC_VER || defined(__MINGW32__)
|
|
||||||
if (!(inpf = Yap_RegistryGetString("startup")))
|
|
||||||
#endif
|
|
||||||
inpf = StartUpFile;
|
inpf = StartUpFile;
|
||||||
}
|
}
|
||||||
/* careful it starts from the root */
|
/* careful it starts from the root */
|
||||||
@ -1510,6 +1507,13 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if _MSC_VER || defined(__MINGW32__)
|
#if _MSC_VER || defined(__MINGW32__)
|
||||||
|
if ((inpf = Yap_RegistryGetString("startup"))) {
|
||||||
|
if ((splfild = open_file(inpf, O_RDONLY)) > 0) {
|
||||||
|
if ((mode = try_open(inpf,Astate,ATrail,AStack,AHeap,save_buffer,streamp)) != FAIL_RESTORE) {
|
||||||
|
return mode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
DWORD fatts;
|
DWORD fatts;
|
||||||
int buflen;
|
int buflen;
|
||||||
@ -1525,7 +1529,7 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
buflen = strlen(LOCAL_FileNameBuf);
|
buflen = strlen(LOCAL_FileNameBuf);
|
||||||
pt = LOCAL_FileNameBuf+strlen(LOCAL_FileNameBuf);
|
pt = LOCAL_FileNameBuf+buflen;
|
||||||
while (*--pt != '\\') {
|
while (*--pt != '\\') {
|
||||||
/* skip executable */
|
/* skip executable */
|
||||||
if (pt == LOCAL_FileNameBuf) {
|
if (pt == LOCAL_FileNameBuf) {
|
||||||
|
Reference in New Issue
Block a user