forked from speedie/spmenu
password argument fix
This commit is contained in:
parent
f773ca8a38
commit
d91dec4010
1
TODO
1
TODO
|
@ -4,4 +4,3 @@
|
|||
- Add configuration file using (probably) libconfig
|
||||
- Use higher level libraries, MD5() is deprecated as of OpenSSL 3 but it has been temporarily silenced. This might also improve compatibility for people who don't use OpenSSL.
|
||||
- Contextual completions
|
||||
- Fix segmentation fault when using -P option (i don't have time to fix it just yet)
|
||||
|
|
|
@ -70,9 +70,6 @@ You may use long, descriptive arguments or the shorter arguments.
|
|||
`-P, --password `
|
||||
: Hide characters
|
||||
|
||||
`-Ps, --password-symbol symbol `
|
||||
: Set the password symbol to symbol
|
||||
|
||||
`-p, --prompt text `
|
||||
: Set spmenu prompt text to text
|
||||
|
||||
|
|
|
@ -169,8 +169,6 @@ readargs(int argc, char *argv[])
|
|||
if (lines == 0) lines = 1;
|
||||
} else if (!strcmp(argv[i], "-mc") || (!strcmp(argv[i], "--max-cache"))) { // max cache
|
||||
maxcache = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "-") || (!strcmp(argv[i], "--password-symbol"))) { // password symbol
|
||||
password = argv[++i];
|
||||
} else if (!strcmp(argv[i], "-l") || (!strcmp(argv[i], "--lines"))) { // number of lines in grid
|
||||
lines = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "-mh") || (!strcmp(argv[i], "--lineheight"))) { // line height
|
||||
|
@ -363,7 +361,6 @@ usage(void)
|
|||
"spmenu -F, --fuzzy Enable fuzzy matching\n"
|
||||
"spmenu -NF, --no-fuzzy Disable fuzzy matching\n"
|
||||
"spmenu -P, --password Hide characters\n"
|
||||
"spmenu -Ps, --password-symbol <symbol> Set the password symbol to <symbol>\n"
|
||||
"spmenu -p, --prompt <text> Set spmenu prompt text to <text>\n"
|
||||
"spmenu -ip, --indent Indent items to prompt width\n"
|
||||
"spmenu -nip, --no-indent Don't indent items to prompt width\n"
|
||||
|
|
|
@ -250,8 +250,8 @@ drawinput(int x, int y, int w)
|
|||
w = (lines > 0 || !matches) ? mw - x : inputw;
|
||||
drw_setscheme(drw, scheme[SchemeInput]);
|
||||
if (passwd && !hideprompt) {
|
||||
censort = ecalloc(pango_input ? TEXTWM(password) : TEXTW(password), sizeof(text));
|
||||
memset(censort, *password, strlen(text));
|
||||
censort = ecalloc(1, sizeof(text));
|
||||
memset(censort, (int)password, strlen(text));
|
||||
|
||||
apply_fribidi(censort);
|
||||
drw_text(drw, x, 0, w, bh, lrpad / 2, isrtl ? fribidi_text : censort, 0, pango_password ? True : False);
|
||||
|
|
|
@ -40,7 +40,7 @@ static char font[] = "Noto Sans Mono 8"; /* Font to draw tex
|
|||
/* Symbol options */
|
||||
static char *leftarrow = "<"; /* Left arrow, used to indicate you can move to the left */
|
||||
static char *rightarrow = ">"; /* Right arrow, used to indicate you can move to the right */
|
||||
static char *password = "."; /* Password character, when the -P argument is active this will replace all characters typed */
|
||||
static char password = '*'; /* Password character, when the -P argument is active this will replace all characters typed */
|
||||
|
||||
/* Match options */
|
||||
static int type = 1; /* Allow typing into spmenu or only allow keybinds. */
|
||||
|
|
Loading…
Reference in a new issue