From 612ea8d837f14a15a44c2d4941ff62c0ebf30461 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 11 Jun 2013 18:44:10 +0300 Subject: Improve fix for debugger on Windows. --- debug.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'debug.c') 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) { -- cgit v1.2.3