summaryrefslogtreecommitdiff
path: root/src/getstring.c
AgeCommit message (Collapse)Author
2012-05-21Switch to Linux kernel coding styleLukas Fleischer
Convert our code base to adhere to Linux kernel coding style using Lindent, with the following exceptions: * Use spaces, instead of tabs, for indentation. * Use 2-character indentations (instead of 8 characters). Rationale: We currently have too much levels of indentation. Using 8-character tabs would make huge code parts unreadable. These need to be cleaned up before we can switch to 8 characters. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2012-03-26Update copyright rangesLukas Fleischer
Add 2012 to the copyright range for all source and documentation files. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-11-02Remove parentheses from return statementsLukas Fleischer
No reason to use "return (x);" here. Refer to the GNU coding guidelines for details. Created using following semantic patch: @@ expression expr; @@ - return (expr); + return expr; Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-11-02Do not cast unused return values to voidLukas Fleischer
A small style fix that removes all remaining "(void)" casts. Using these isn't encouraged in GNU coding guidelines and doesn't serve a certain purpose, except for satisfying a few static code analysis tools. We already nuked some of these in previous patches, but this semantic patch should fix what's left: @@ identifier func; @@ - (void)func ( + func ( ...); Long lines were re-formatted manually. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-11-02Avoid use of printf()/fprintf()Lukas Fleischer
Use one of the following functions where appropriate: * puts() (whenever we print hard coded strings to stdout) * fputs() (whenever we print hard coded strings to a stream) * putchar() (whenever we print a single character to stdout) * fputc() (whenever we print a single character to a stream) * strncpy() (whenever we copy hard coded strings to a buffer) This removes the overhead introduced by the format string parser and reduces the number of false positive C-format strings spotted by xgettext(1)'s heuristics. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02Avoid segfault in getstr_fixscr()Lukas Fleischer
Avoid a segfault that may occur if getstr_fixscr() changes the scroll offset to something outside the input boundaries (e.g. if a word that is only partly visible is killed via backward-kill-word). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02Use constant for maximum UTF-8 character sizeLukas Fleischer
Introduce a UTF8_MAXLEN constant instead of using the literal value "6" at various places. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-07-02Refactor getstring codeLukas Fleischer
* Rename static showstring() function to getstr_print(), rename ins_char() to getstr_ins_char() and del_char() to getstr_del_char(). * Refactor out getstring data structure initialization and window scrolling routines. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29Make getstring() UTF-8 compatibleLukas Fleischer
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
2011-06-29Split line editing functions into separate fileLukas Fleischer
Move getstring() related stuff into a separate file as a first step on our way to UTF-8 support for line editing helpers. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>