aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/debug.c b/debug.c
index d60164aa..6d3936b1 100644
--- a/debug.c
+++ b/debug.c
@@ -519,6 +519,9 @@ 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);
@@ -534,6 +537,7 @@ print_lines(char *src, int start_line, int nlines)
src, strerror(errno));
return -1;
}
+ os_setbinmode(s->fd, O_BINARY);
}
if (s->line_offset == NULL && find_lines(s) != 0)