diff options
author | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-12 01:38:44 (EST) |
---|---|---|
committer | graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-11-12 01:38:44 (EST) |
commit | f0920f2896c409d519e51744a2e2618a99ec8b8c (patch) | |
tree | 677f64e19d7f2fc4b833411fd44e8014836aba56 /libopkg/opkg_install.c | |
parent | 99be91a0fdb86a6826a0cdcf8bede14b7d01c9a8 (diff) |
Don't prompt for user input from stdin if it's not a tty.
Based off a patch by Chris Larson <clarson@mvista.com> for OpenEmbedded.
git-svn-id: http://opkg.googlecode.com/svn/trunk@290 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/opkg_install.c')
-rw-r--r-- | libopkg/opkg_install.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c index a76322d..52af71e 100644 --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c @@ -1608,6 +1608,10 @@ static int user_prefers_old_conffile(const char *file_name, const char *backup) " D : show the differences between the versions (if diff is installed)\n" " The default action is to keep your current version.\n" " *** %s (Y/I/N/O/D) [default=N] ? ", file_name, short_file_name); + + if (response == NULL) + return 1; + if (strcmp(response, "y") == 0 || strcmp(response, "i") == 0 || strcmp(response, "yes") == 0) { |