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

@ -393,22 +393,31 @@ parse_yap_arguments(int argc, char *argv[], YAP_init_args *iap)
#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) {
fprintf(stderr,
" [ YAP unrecoverable error: missing file name with option 'L' ]\n");
exit(1); exit(1);
} }
argv++; p = *++argv;
if (p[0] == '-' && p[1] == '-'&& p[2] == '\0') { if (p[0] == '-' && p[1] == '-' && p[2] == '\0') {
/* we're done here */ if (--argc == 0) {
argc = 1; fprintf(stderr,
" [ YAP unrecoverable error: missing filename with option 'L' ]\n");
exit(1);
}
p = *++argv;
iap->YapPrologRCFile = p;
argc = 1;
} else {
iap->YapPrologRCFile = p;
}
} }
iap->YapPrologRCFile = *argv;
argv++;
iap->HaltAfterConsult = TRUE;
break; break;
case 'l': case 'l':
if ((*argv)[0] == '\0') if ((*argv)[0] == '\0')