aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--debug.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c7efe8b..29617a3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2013-06-10 Arnold D. Robbins <arnold@skeeve.com>
+ * debug.c (print_lines): Set binary mode so that calculation of the
+ byte offsets will be right. Thanks to Corinna Vinschen for the
+ direction.
+
+2013-06-10 Arnold D. Robbins <arnold@skeeve.com>
+
* re.c (check_bracket_exp): Remove warning about ranges being
locale dependent, since they aren't anymore.
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)