From 645b7eb172fa0ac59d84ef3b7c5c2b03708293a7 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Thu, 21 May 2009 11:22:14 +0000 Subject: [PATCH] Load user options which override the default ones --- src/main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main.c b/src/main.c index daad142..64ca4ff 100644 --- a/src/main.c +++ b/src/main.c @@ -433,6 +433,26 @@ static void parse_cmdline_and_init_file (int argc, char **argv) fix_options (); parse_cmdline (argc, argv); + /* FIXME! ska: This is temporary, and will be removed when you can + * pass command line options in meta.xml for the homebrew channel */ + { + char user_options[255]; + char *user_argv[] = {"program", "-f", user_options}; +#ifdef OPTIONS_IN_HOME + char *home = getenv ("HOME"); + if (home != NULL && strlen (home) < 240) + { + strcpy (user_options, home); + strcat (user_options, "/"); + } +#endif + strcat(user_options, OPTIONSFILENAME); + strcat(user_options, ".user"); + + /* Allow the user uaerc to override the default one */ + parse_cmdline (3, user_argv); + } + /* Until here */ fix_options (); }