mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
Merge branch 'fgets-error-ignore' into 'main'
gio-tool-mount: Return early on fgets EOF Closes #2737 See merge request GNOME/glib!2870
This commit is contained in:
commit
1f4188f0ab
@ -113,7 +113,15 @@ prompt_for (const char *prompt, const char *default_value, gboolean echo)
|
||||
#endif
|
||||
|
||||
if (!fgets (data, sizeof (data), stdin))
|
||||
g_error ("Failed to read from standard input");
|
||||
{
|
||||
if (feof (stdin))
|
||||
{
|
||||
g_print ("\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
g_error ("Failed to read from standard input");
|
||||
}
|
||||
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
if (restore_flags)
|
||||
|
Loading…
Reference in New Issue
Block a user