projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25015bb
)
Fix last commit (ChangeLog entry still applicable).
author
Simon Josefsson
<simon@josefsson.org>
Thu, 10 Nov 2005 14:50:28 +0000
(14:50 +0000)
committer
Simon Josefsson
<simon@josefsson.org>
Thu, 10 Nov 2005 14:50:28 +0000
(14:50 +0000)
lib/readline.c
patch
|
blob
|
history
diff --git
a/lib/readline.c
b/lib/readline.c
index f2ddcaaaa13285e57618e71c7f85ccf65512e74a..88f39b21031ab401f1aaf40d4b42892281b4fd0b 100644
(file)
--- a/
lib/readline.c
+++ b/
lib/readline.c
@@
-48,9
+48,8
@@
readline (const char *prompt)
if (getline (&out, &size, stdin) < 0)
return NULL;
- if (out[strlen (out) - 1] == '\r')
- out[strlen (out) - 1] = '\0';
- if (out[strlen (out) - 1] == '\n')
+ while (*out && (out[strlen (out) - 1] == '\r'
+ || out[strlen (out) - 1] == '\n'))
out[strlen (out) - 1] = '\0';
return out;