diff options
author | Daniel Jacobowitz <dan@debian.org> | 2006-03-21 14:58:24 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2006-03-21 14:58:24 +0000 |
commit | a7d7a275a15ea4f16a9638e62967d121a7e39f0a (patch) | |
tree | 0e197836ff7f386ff192c979bff77f720c05af8e /readline/histfile.c | |
parent | dc33be2ad3aabdda110aa6ce83d821b743889023 (diff) | |
download | gdb-a7d7a275a15ea4f16a9638e62967d121a7e39f0a.tar.gz |
* histfile.c (read_history_range): Remove '\r' character from
history lines.
Diffstat (limited to 'readline/histfile.c')
-rw-r--r-- | readline/histfile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/readline/histfile.c b/readline/histfile.c index 60a91251b7a..c19630dc8f3 100644 --- a/readline/histfile.c +++ b/readline/histfile.c @@ -228,7 +228,10 @@ read_history_range (filename, from, to) for (line_end = line_start; line_end < bufend; line_end++) if (*line_end == '\n') { - *line_end = '\0'; + if (line_end - 1 >= line_start && *(line_end - 1) == '\r') + *(line_end - 1) = '\0'; + else + *line_end = '\0'; if (*line_start) add_history (line_start); |