summaryrefslogtreecommitdiffstats
path: root/expac.c
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-12-01 13:46:00 -0500
committerDave Reisner <d@falconindy.com>2010-12-01 13:46:00 -0500
commitdd7d84ccf6c8df0f106025d075987a180e653a49 (patch)
tree1725ce9faf3994fb26b7314b007552a45ea1e845 /expac.c
parentf4e8889f78ea7d2c5655c45c977abf8cef6e79f7 (diff)
downloadexpac-dd7d84ccf6c8df0f106025d075987a180e653a49.tar.xz
don't hardcode defaults
Diffstat (limited to 'expac.c')
-rw-r--r--expac.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/expac.c b/expac.c
index 6e4ddba..96598fe 100644
--- a/expac.c
+++ b/expac.c
@@ -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);