Eric Pouech : winedbg: Also get rid of trailing \r in input_read_line.

Alexandre Julliard julliard at winehq.org
Wed Mar 16 12:22:36 CDT 2011


Module: wine
Branch: master
Commit: 77eefaed583ad3f6c53378c63b364d0dcc6912c5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=77eefaed583ad3f6c53378c63b364d0dcc6912c5

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Tue Mar 15 22:26:49 2011 +0100

winedbg: Also get rid of trailing \r in input_read_line.

---

 programs/winedbg/dbg.y |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/winedbg/dbg.y b/programs/winedbg/dbg.y
index c7e2c3b..4f2da25 100644
--- a/programs/winedbg/dbg.y
+++ b/programs/winedbg/dbg.y
@@ -507,8 +507,8 @@ int input_read_line(const char* pfx, char* buf, int size)
 
     int len = input_fetch_entire_line(pfx, &line);
     if (len < 0) return 0;
-    /* remove trailing \n */
-    if (len > 0 && line[len - 1] == '\n') len--;
+    /* remove trailing \n and \r */
+    while (len > 0 && (line[len - 1] == '\n' || line[len - 1] == '\r')) len--;
     len = min(size - 1, len);
     memcpy(buf, line, len);
     buf[len] = '\0';




More information about the wine-cvs mailing list