X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-setup.c;h=622bbaa68343c7633ade295d794e86e66c64d137;hp=5ec176d372a74e9b65c31846dc33fbe7ed95d22c;hb=bb5211684654b7cf54f842990a733a64fe01d612;hpb=34c840a23e1db4c6cf4a836b441d027fc17e9706 diff --git a/notmuch-setup.c b/notmuch-setup.c index 5ec176d3..622bbaa6 100644 --- a/notmuch-setup.c +++ b/notmuch-setup.c @@ -100,12 +100,15 @@ notmuch_setup_command (unused (void *ctx), unsigned int i; int is_new; -#define prompt(format, ...) \ - do { \ - printf (format, ##__VA_ARGS__); \ - fflush (stdout); \ - getline (&response, &response_size, stdin); \ - chomp_newline (response); \ +#define prompt(format, ...) \ + do { \ + printf (format, ##__VA_ARGS__); \ + fflush (stdout); \ + if (getline (&response, &response_size, stdin) < 0) { \ + printf ("Exiting.\n"); \ + exit (1); \ + } \ + chomp_newline (response); \ } while (0) config = notmuch_config_open (ctx, NULL, &is_new);