X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Freadline.c;h=d42f29669e3ca0add8b2a2ae98b9b6101237915d;hb=d0ed135f8b494a0adf869a311c7bdc1d9d03f050;hp=a8db7ec68ec5a34ad967cb536945ac02c0a1c052;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/lib/readline.c b/lib/readline.c index a8db7ec68..d42f29669 100644 --- a/lib/readline.c +++ b/lib/readline.c @@ -1,5 +1,5 @@ /* readline.c --- Simple implementation of readline. - Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. Written by Simon Josefsson This program is free software: you can redistribute it and/or modify @@ -39,13 +39,16 @@ readline (const char *prompt) size_t size = 0; if (prompt) - fputs (prompt, stdout); + { + fputs (prompt, stdout); + fflush (stdout); + } if (getline (&out, &size, stdin) < 0) return NULL; while (*out && (out[strlen (out) - 1] == '\r' - || out[strlen (out) - 1] == '\n')) + || out[strlen (out) - 1] == '\n')) out[strlen (out) - 1] = '\0'; return out;