changeset 36834:1527f40de3b3

ui: remove any combinations of CR|LF from prompt response On Windows, we have to accept both CR+LF and LF. This patch simply makes any trailing CRs and LFs removed from a user input instead of doing stricter parsing, as an input must be a readable text.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 10 Mar 2018 15:50:09 +0900
parents 46f4d71ed505
children 5bc7ff103081
files mercurial/ui.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Sat Mar 10 12:45:10 2018 -0500
+++ b/mercurial/ui.py	Sat Mar 10 15:50:09 2018 +0900
@@ -1296,8 +1296,7 @@
                 line = self.fin.readline()
                 if not line:
                     raise EOFError
-                if line.endswith(pycompat.oslinesep):
-                    line = line[:-len(pycompat.oslinesep)]
+                line = line.rstrip(pycompat.oslinesep)
 
         return line