X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Freadline.c;h=0adb8e5e0531c9cd882522190fd79fd9a8f0ade9;hb=82781cc8ba8aa1831f3fce91ce14b8538f5319f0;hp=a8db7ec68ec5a34ad967cb536945ac02c0a1c052;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/lib/readline.c b/lib/readline.c index a8db7ec68..0adb8e5e0 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-2007, 2009-2012 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;