apply Takeuuchi's patch for -L

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1397 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2005-10-15 02:05:14 +00:00
parent 7d5dbe04cd
commit a09b33381e

View File

@ -392,24 +392,33 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
break; break;
#endif #endif
case 'L': case 'L':
p++; p++;
while (*p != '\0' && (*p == ' ' || *p == '\t')) iap->HaltAfterConsult = TRUE;
p++; if (*p != '\0') {
/* skip zeroth argument */ iap->YapPrologRCFile = p;
argc--; break;
if (argc == 0) { } else {
fprintf(stderr," [ YAP unrecoverable error: missing file name with option 'l' ]\n"); if (--argc == 0) {
exit(1); fprintf(stderr,
} " [ YAP unrecoverable error: missing file name with option 'L' ]\n");
argv++; exit(1);
if (p[0] == '-' && p[1] == '-'&& p[2] == '\0') { }
/* we're done here */ p = *++argv;
argc = 1; if (p[0] == '-' && p[1] == '-' && p[2] == '\0') {
} if (--argc == 0) {
iap->YapPrologRCFile = *argv; fprintf(stderr,
argv++; " [ YAP unrecoverable error: missing filename with option 'L' ]\n");
iap->HaltAfterConsult = TRUE; exit(1);
break; }
p = *++argv;
iap->YapPrologRCFile = p;
argc = 1;
} else {
iap->YapPrologRCFile = p;
}
}
break;
case 'l': case 'l':
if ((*argv)[0] == '\0') if ((*argv)[0] == '\0')
iap->YapPrologRCFile = *argv; iap->YapPrologRCFile = *argv;