This patch allows the computer to reboot if the user does not enter a value for the path to a server.
James A. Morrison 2003-01-20 James A. Morrison <[EMAIL PROTECTED]> * init.c (getstring): Return 0 if the user only presses enter. Index: init.c =================================================================== RCS file: /cvsroot/hurd/hurd/init/init.c,v retrieving revision 1.129 diff -u -r1.129 init.c --- init.c 8 May 2002 09:20:38 -0000 1.129 +++ init.c 21 Jan 2003 01:05:24 -0000 @@ -145,14 +145,15 @@ static int getstring (char *buf, size_t bufsize) { - if (fgets (buf, bufsize, stdin) != NULL && buf[0] != '\0') - { - size_t len = strlen (buf); - if (buf[len - 1] == '\n' || buf[len - 1] == '\r') - buf[len - 1] = '\0'; - return 1; - } - return 0; + /* fail if fgets fails or the uses simply presses enter */ + if (fgets (buf, bufsize, stdin) == NULL || buf[0] == '\0' + || buf[0] == '\n' || buf[0] == '\r') + return 0; + + size_t len = strlen (buf); + if (buf[len - 1] == '\n' || buf[len - 1] == '\r') + buf[len - 1] = '\0'; + return 1; } _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-hurd