aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-06-11 18:44:10 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-06-11 18:44:10 +0300
commit612ea8d837f14a15a44c2d4941ff62c0ebf30461 (patch)
tree1770be5b52e131c0b2150c72a1f42c2301d17c51 /debug.c
parent21c8b6d547b12942775d675ead2994992285c04c (diff)
downloadegawk-612ea8d837f14a15a44c2d4941ff62c0ebf30461.tar.gz
egawk-612ea8d837f14a15a44c2d4941ff62c0ebf30461.tar.bz2
egawk-612ea8d837f14a15a44c2d4941ff62c0ebf30461.zip
Improve fix for debugger on Windows.
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/debug.c b/debug.c
index 6d3936b1..0cb9d562 100644
--- a/debug.c
+++ b/debug.c
@@ -519,9 +519,6 @@ print_lines(char *src, int start_line, int nlines)
return -1;
}
- /* set binary mode so that byte offset calculations will be right */
- os_setbinmode(s->fd, O_BINARY);
-
if (fstat(s->fd, &sbuf) == 0 && s->mtime < sbuf.st_mtime) {
fprintf(out_fp, _("WARNING: source file `%s' modified since program compilation.\n"),
src);
@@ -537,9 +534,11 @@ print_lines(char *src, int start_line, int nlines)
src, strerror(errno));
return -1;
}
- os_setbinmode(s->fd, O_BINARY);
}
+ /* set binary mode so that byte offset calculations will be right */
+ os_setbinmode(s->fd, O_BINARY);
+
if (s->line_offset == NULL && find_lines(s) != 0)
return -1;
if (start_line < 1 || start_line > s->srclines) {