aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-02-13 20:30:03 +0200
committerArnold D. Robbins <arnold@skeeve.com>2011-02-13 20:30:03 +0200
commit32086b1f52a9978db1e8168b56a312e76afcf5ab (patch)
treede490c1c7d47bcbc6428d622957240679483d6b6 /debug.c
parent6bfbae33e99c401f89a4d650ea7958bbdebd362e (diff)
downloadegawk-32086b1f52a9978db1e8168b56a312e76afcf5ab.tar.gz
egawk-32086b1f52a9978db1e8168b56a312e76afcf5ab.tar.bz2
egawk-32086b1f52a9978db1e8168b56a312e76afcf5ab.zip
PC fixes for portability and dependencies.
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/debug.c b/debug.c
index c54af488..fafbc7f7 100644
--- a/debug.c
+++ b/debug.c
@@ -496,11 +496,13 @@ source_find(char *src)
path = find_source(src, &sbuf, &errno_val);
if (path != NULL) {
- efree(path);
for (s = srcfiles->next; s != srcfiles; s = s->next) {
if ((s->stype == SRC_FILE || s->stype == SRC_INC)
- && files_are_same(& s->sbuf, & sbuf))
+ && files_are_same(path, s)) {
+ efree(path);
return s;
+ }
+ efree(path);
}
}
@@ -2736,7 +2738,7 @@ interpret(INSTRUCTION *pc)
input_fd = fileno(stdin);
out_fp = stdout;
- if (isatty(input_fd))
+ if (ISATTY(input_fd))
input_from_tty = TRUE;
if (input_fd == 0 && input_from_tty)
initialize_readline();
@@ -4084,7 +4086,7 @@ do_option(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
void
initialize_pager(FILE *fp)
{
- if (! isatty(fileno(fp)) || ! input_from_tty || input_fd != 0) {
+ if (! ISATTY(fileno(fp)) || ! input_from_tty || input_fd != 0) {
screen_width = INT_MAX;
screen_height = INT_MAX;
} else {
@@ -4108,7 +4110,7 @@ prompt_continue(FILE *fp)
{
int quit_pager = FALSE;
- if (isatty(fileno(fp)) && input_fd == 0)
+ if (ISATTY(fileno(fp)) && input_fd == 0)
quit_pager = prompt_yes_no(
_("\t------[Enter] to continue or q [Enter] to quit------"),
_("q")[0], FALSE, fp);
@@ -5066,7 +5068,7 @@ set_gawk_output(const char *file)
efree(output_file);
}
output_fp = stdout;
- output_is_tty = isatty(fileno(stdout));
+ output_is_tty = ISATTY(fileno(stdout));
output_file = "/dev/stdout";
}
@@ -5087,7 +5089,7 @@ set_gawk_output(const char *file)
if (STREQ(cp, "stderr")) {
output_fp = stderr;
output_file = "/dev/stderr";
- output_is_tty = isatty(fileno(stderr));
+ output_is_tty = ISATTY(fileno(stderr));
return;
}
@@ -5120,7 +5122,7 @@ set_gawk_output(const char *file)
output_fp = fp;
output_file = estrdup(file, strlen(file));
setbuf(fp, (char *) NULL);
- output_is_tty = isatty(fileno(fp));
+ output_is_tty = ISATTY(fileno(fp));
} else {
d_error(_("could not open `%s' for writing (%s)"),
file,