2006-10-10 Denis PILAT * source.c (find_source_lines): Treat the case of source file whith '\r' only end-of-line. Index: source.c =================================================================== --- source.c (revision 528) +++ source.c (working copy) @@ -1074,7 +1074,11 @@ find_source_lines (struct symtab *s, int nlines = 1; while (p != end) { - if (*p++ == '\n' + /* Skip the \r in case of \r\n end-of-line. */ + if (*p == '\r' && *(p + 1) == '\n') + p++; + /* Lines could end with '\n' or '\r' only. */ + if ((*p == '\n' || *p == '\r') /* A newline at the end does not start a new line. */ && p != end) { @@ -1085,8 +1089,9 @@ find_source_lines (struct symtab *s, int (int *) xrealloc ((char *) line_charpos, sizeof (int) * lines_allocated); } - line_charpos[nlines++] = p - data; + line_charpos[nlines++] = p + 1 - data; } + p++; } do_cleanups (old_cleanups); }