Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Comment: | Don't overwrite fields if only carriage return is entered
In other words, prevent accidentally deleting fields. This has always This small change means that if you just enter return then the old value This is good enough for me. There is one downside: if you really want to |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | origin/tweaks | trunk |
Files: | files | file ages | folders |
SHA3-256: |
1559d3c95645eb1cb6ab8c55a25d559e |
User & Date: | atomicules@lavabit.com 2013-03-22 17:02:02 |
2013-03-23
| ||
21:27 |
Extend the "don't overwrite fields if only carriage return is entered" to password field
And also use malloc. What I'd done before wasn't doing what I thought. C I'm in two minds about the benefit of dynamic allocation though. Since | |
2013-03-22
| ||
17:02 |
Don't overwrite fields if only carriage return is entered
In other words, prevent accidentally deleting fields. This has always This small change means that if you just enter return then the old value This is good enough for me. There is one downside: if you really want to | |
17:01 | Merge branch 'modernise' into tweaks2 check-in: 9ed6b07353 user: atomicules@lavabit.com tags: origin/tweaks, trunk | |
Changes to src/ui.c.
︙ | ︙ | |||
458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | char * ui_statusline_ask_str(char *msg, char *input, int len) { char *tmp; char *tmp2; char *tmp3; int x = strlen(msg) + 5; if(input == NULL){ input = malloc(len); } ui_statusline_clear(); ui_statusline_msg(msg); echo(); show_cursor(); mvwgetnstr(bottom, 1, x, input, len); noecho(); hide_cursor(); ui_statusline_clear(); // Tabs don't play nicely with ncurses or xml // So, swap any for (a single) space tmp = input; while(*tmp != 0) { if(*tmp == 9) *tmp = ' '; tmp++; | > > > > > > > > > | 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 | char * ui_statusline_ask_str(char *msg, char *input, int len) { char *tmp; char *tmp2; char *tmp3; char oldinput[strlen(input)]; int x = strlen(msg) + 5; //Back-up the old value strcpy(oldinput, input); if(input == NULL){ input = malloc(len); } ui_statusline_clear(); ui_statusline_msg(msg); echo(); show_cursor(); mvwgetnstr(bottom, 1, x, input, len); noecho(); hide_cursor(); ui_statusline_clear(); //If just return entered, don't overwrite old value if(strlen(input) == 0){ strcpy(input, oldinput); } // Tabs don't play nicely with ncurses or xml // So, swap any for (a single) space tmp = input; while(*tmp != 0) { if(*tmp == 9) *tmp = ' '; tmp++; |
︙ | ︙ |