diff packages/redboot/current/src/io.c @ 191:678094f34118

Merge from eCos master repository on 2001-10-19-06:43:02-BST
author jlarmour
date Fri, 19 Oct 2001 07:02:26 +0000
parents f62680ef1804
children feb0fcf83327
line wrap: on
line diff
--- a/packages/redboot/current/src/io.c
+++ b/packages/redboot/current/src/io.c
@@ -297,7 +297,8 @@ int
         else
 #endif
         if ((timeout > 0) && (ptr == buf)) {
-            mon_set_read_char_timeout(timeout);
+#define MIN_TIMEOUT 50
+            mon_set_read_char_timeout(timeout > MIN_TIMEOUT ? MIN_TIMEOUT : timeout);
             while (timeout > 0) {
                 res = mon_read_char_with_timeout(&c);
                 if (res) {
@@ -305,7 +306,7 @@ int
                     do_idle(false);
                     break;
                 }
-                timeout -= 50;
+                timeout -= MIN_TIMEOUT;
             }
             if (res == false) {
                 do_idle(true);
@@ -349,15 +350,6 @@ int
                 ptr--;
             }
             break;
-        case '\\':                 // escape character
-            if (console_echo) {
-                mon_write_char(c);
-            }
-            if (last_ch != '\\') // if last was also an escape, 
-                break;             // don't add to buffer, just move on
-            *ptr++ = c;
-            c = '\0';    // cheat so that the "shift" state resets
-            break;
 #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
         case '+': // fall through
         case '$':
@@ -367,6 +359,9 @@ int
                 ungetDebugChar(c);  // Push back character so stubs will see it
                 return _GETS_GDB;
             }
+            if (last_ch == '\\') {
+                ptr--;  // Save \$ as $
+            }
             // else fall through
 #endif
         default: