diff options
author | Dave Reisner <d@falconindy.com> | 2010-12-01 13:46:00 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-12-01 13:46:00 -0500 |
commit | dd7d84ccf6c8df0f106025d075987a180e653a49 (patch) | |
tree | 1725ce9faf3994fb26b7314b007552a45ea1e845 | |
parent | f4e8889f78ea7d2c5655c45c977abf8cef6e79f7 (diff) | |
download | expac-dd7d84ccf6c8df0f106025d075987a180e653a49.tar.xz |
don't hardcode defaults
-rw-r--r-- | expac.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -34,6 +34,9 @@ #include <stdlib.h> #include <string.h> +#define DEFAULT_DELIM "\n" +#define DEFAULT_LISTDELIM " " +#define DEFAULT_TIMEFMT "%c" #define FORMAT_TOKENS "BCDEGLNOPRSabdkmnprsuvw%" #define FORMAT_TOKENS_LOCAL "ilFw" #define FORMAT_TOKENS_SYNC "f" @@ -535,7 +538,7 @@ alpm_list_t *resolve_pkg(alpm_list_t *targets) { } int main(int argc, char *argv[]) { - int ret = 0; + int ret; alpm_list_t *results, *i; ret = alpm_init(); @@ -553,9 +556,9 @@ int main(int argc, char *argv[]) { local = true; dblist = alpm_list_add(dblist, db_local); } - delim = delim ? delim : "\n"; - listdelim = listdelim ? listdelim : " "; - timefmt = timefmt ? timefmt : "%c"; + delim = delim ? delim : DEFAULT_DELIM; + listdelim = listdelim ? listdelim : DEFAULT_LISTDELIM; + timefmt = timefmt ? timefmt : DEFAULT_TIMEFMT; if (verify_format_string(format) != 0) { return(1); |