diff lib/password.c @ 1308:1493a21160a4 draft

patch from ashwini sharma: treat 0 length read at the start of password read as EOF.
author Rob Landley <rob@landley.net>
date Sat, 24 May 2014 12:48:32 -0500
parents 63db77909fc8
children e65f9a9ba62d
line wrap: on
line diff
--- a/lib/password.c	Fri May 23 09:00:09 2014 -0500
+++ b/lib/password.c	Sat May 24 12:48:32 2014 -0500
@@ -79,7 +79,7 @@
 
   while (1) {
     int ret = read(0, &buff[i], 1);
-    if ( ret < 0 ) {
+    if ( ret < 0 || (!ret && !i)) {
       buff[0] = 0;
       sigaction(SIGINT, &oldsa, NULL);
       tcsetattr(0, TCSANOW, &oldtermio);