maint: update all copyright year number ranges
[gnulib.git] / lib / readline.c
index a8db7ec..4c67e89 100644 (file)
@@ -1,5 +1,5 @@
 /* readline.c --- Simple implementation of readline.
-   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2013 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;