ttyin.c.diff   [plain text]


--- ttyin.c.orig	2005-12-03 12:20:32.000000000 -0800
+++ ttyin.c	2006-01-25 20:34:49.000000000 -0800
@@ -27,6 +27,8 @@ static DWORD console_mode;
 public int tty;
 extern int sigs;
 extern int utf_mode;
+extern char * active_dashp_command;
+extern int add_newline;
 
 /*
  * Open keyboard for input.
@@ -105,6 +107,20 @@ getchr()
 	int hex_in = 0;
 	int hex_value = 0;
 
+	if (active_dashp_command) {
+		/* Use it until all gone */
+		c = *active_dashp_command++;
+		if (c =='\0') {
+			active_dashp_command = NULL;
+			if (add_newline) {
+				c = '\n';
+				add_newline = 0;
+				return (c & 0377);
+			}
+		} else 
+			return (c & 0377);
+	}
+
 	do
 	{
 #if MSDOS_COMPILER && MSDOS_COMPILER != DJGPPC