end += 2;
if (widetag_of(obj) == SIMPLE_FUN_HEADER_WIDETAG) {
print((long)addr | FUN_POINTER_LOWTAG);
- } else if (lowtag_of(obj) == OTHER_IMMEDIATE_0_LOWTAG ||
- lowtag_of(obj) == OTHER_IMMEDIATE_1_LOWTAG) {
+ } else if (other_immediate_lowtag_p(obj)) {
print((lispobj)addr | OTHER_POINTER_LOWTAG);
} else {
print((lispobj)addr);
printf("Really quit? [y] ");
fflush(stdout);
- fgets(buf, sizeof(buf), ldb_in);
- if (buf[0] == 'y' || buf[0] == 'Y' || buf[0] == '\n')
+ if (fgets(buf, sizeof(buf), ldb_in)) {
+ if (buf[0] == 'y' || buf[0] == 'Y' || buf[0] == '\n')
+ exit(1);
+ } else {
+ printf("\nUnable to read response, assuming y.\n");
exit(1);
+ }
}
static void
if (!ldb_in) {
#ifndef LISP_FEATURE_WIN32
ldb_in = fopen("/dev/tty","r+");
+ if (ldb_in == NULL) {
+ perror("Error opening /dev/tty");
+ ldb_in = stdin;
+ }
#else
ldb_in = stdin;
#endif