Don't ignore stdin in password mode - wmenu - 🔧 fork of wmenu
 (HTM) git clone git@git.drkhsh.at/wmenu.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 30abca4f301a3e851d020119f654586c56c70263
 (DIR) parent 15d7c7bcc29e66f174c4de2420d371a9737ac6e4
 (HTM) Author: adnano <me@adnano.co>
       Date:   Sun,  5 May 2024 10:13:01 -0400
       
       Don't ignore stdin in password mode
       
       This makes password mode work for wmenu and wmenu-run without special
       cases.
       
       Diffstat:
         M docs/wmenu.1.scd                    |       2 +-
         M menu.c                              |       2 +-
         M wmenu.c                             |       4 +---
       
       3 files changed, 3 insertions(+), 5 deletions(-)
       ---
 (DIR) diff --git a/docs/wmenu.1.scd b/docs/wmenu.1.scd
       @@ -37,7 +37,7 @@ $PATH and runs the result.
        
        *-P*
                wmenu will not directly display the keyboard input, but instead replace it
       -        with asterisks. All data from stdin will be ignored.
       +        with asterisks.
        
        *-v*
                prints version information to stdout, then exits.
 (DIR) diff --git a/menu.c b/menu.c
       @@ -85,7 +85,7 @@ static bool parse_color(const char *color, uint32_t *result) {
        // Parse menu options from command line arguments.
        void menu_getopts(struct menu *menu, int argc, char *argv[]) {
                const char *usage =
       -                "Usage: wmenu [-biPvx] [-f font] [-l lines] [-o output] [-p prompt]\n"
       +                "Usage: wmenu [-biPv] [-f font] [-l lines] [-o output] [-p prompt]\n"
                        "\t[-N color] [-n color] [-M color] [-m color] [-S color] [-s color]\n";
        
                int opt;
 (DIR) diff --git a/wmenu.c b/wmenu.c
       @@ -19,9 +19,7 @@ static void read_items(struct menu *menu) {
        int main(int argc, char *argv[]) {
                struct menu *menu = menu_create();
                menu_getopts(menu, argc, argv);
       -        if (!menu->passwd) {
       -                read_items(menu);
       -        }
       +        read_items(menu);
                int status = menu_run(menu);
                menu_destroy(menu);
                return status;