X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=options.c;h=84f08ca64152564978f04c6821751835602f10d6;hb=f3c64248f69b12b759775cbc7e0e01c13fae274f;hp=81f8d2c42306c716a1870473dee6ed6762d5d17c;hpb=98120c2f74691bfe11b47883f27c431d4b9b1de8;p=pkg%2Fabook.git diff --git a/options.c b/options.c index 81f8d2c..84f08ca 100644 --- a/options.c +++ b/options.c @@ -50,11 +50,7 @@ static struct option abook_vars[] = { { "autosave", OT_BOOL, BOOL_AUTOSAVE, TRUE }, { "show_all_emails", OT_BOOL, BOOL_SHOW_ALL_EMAILS, TRUE }, - { "emailpos", OT_INT, INT_EMAILPOS, 25 }, - { "extra_column", OT_STR, STR_EXTRA_COLUMN, UL "phone" }, - { "extra_alternative", OT_STR, STR_EXTRA_ALTERNATIVE, UL "-1" }, - { "extrapos", OT_INT, INT_EXTRAPOS, 65 }, - + { "index_format", OT_STR, STR_INDEX_FORMAT, UL " {name:22} {email:40} {phone:12|workphone|mobile}" }, { "mutt_command", OT_STR, STR_MUTT_COMMAND, UL "mutt" }, { "mutt_return_all_emails", OT_BOOL, BOOL_MUTT_RETURN_ALL_EMAILS, TRUE }, @@ -283,11 +279,12 @@ opt_set_set_option(char *p, struct option *opt) { int len; - strtrim(p); + assert(p); + strtrim(p); len = strlen(p); - if(p[len - 1] == '\"' && *p == '\"') { + if(*p == '\"' && p[len - 1] == '\"') { if(len < 3) return _("invalid value"); p[len - 1] = 0; @@ -317,11 +314,14 @@ opt_set_set_option(char *p, struct option *opt) return NULL; } -static char * +static const char * opt_set_option(char *var, char *p) { int i; + assert(var); + assert(p); + for(i = 0; abook_vars[i].option; i++) if(!strcmp(abook_vars[i].option, var)) return opt_set_set_option(p, &abook_vars[i]); @@ -386,7 +386,7 @@ opt_parse_customfield(buffer *b) /* * syntax: view = [ , , ... ] */ -static char * +static const char * opt_parse_view(buffer *b) { char *err, *view; @@ -416,7 +416,7 @@ opt_parse_view(buffer *b) /* * syntax: field = [ , ] */ -static char * +static const char * opt_parse_field(buffer *b) { char *err, *field, *name;