diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | debug.c | 4 |
2 files changed, 10 insertions, 0 deletions
@@ -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. @@ -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) |