changeset 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 8868e482963e
children ad7d75f97029
files lib/password.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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);