X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=blobdiff_plain;f=pwm%2Fpwm.c;h=0159ccef8ecccff04fb472dc65cd7ee2894b57c8;hp=c4a080474a9458aca9e25b9e144b729563bef60b;hb=e3aec18706513a87eaa7839dfdaf7e0fcd0d8d2a;hpb=de22e45179cb3bafa490294d31d47f361047a30a diff --git a/pwm/pwm.c b/pwm/pwm.c index c4a0804..0159cce 100644 --- a/pwm/pwm.c +++ b/pwm/pwm.c @@ -1,12 +1,9 @@ /* * ion/pwm/pwm.c * - * Copyright (c) Tuomo Valkonen 1999-2007. + * Copyright (c) Tuomo Valkonen 1999-2009. * - * Ion is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. + * See the included file LICENSE for details. */ #include @@ -22,6 +19,7 @@ #include #include #include +#include #include #include @@ -96,20 +94,30 @@ int main(int argc, char*argv[]) char *efnam=NULL; bool may_continue=FALSE; bool noerrorlog=FALSE; - + char *localedir; + libtu_init(argv[0]); - if(!ioncore_init("pwm3", argc, argv, LOCALEDIR)) +#ifdef CF_RELOCATABLE_BIN_LOCATION + prefix_set(argv[0], CF_RELOCATABLE_BIN_LOCATION); +#endif + + localedir=prefix_add(LOCALEDIR); + + if(!ioncore_init("pwm3", argc, argv, localedir)) return EXIT_FAILURE; - extl_add_searchdir(EXTRABINDIR); /* ion-completefile */ - extl_add_searchdir(MODULEDIR); - extl_add_searchdir(ETCDIR); + if(localedir!=NULL) + free(localedir); + + prefix_wrap_simple(extl_add_searchdir, EXTRABINDIR); /* ion-completefile */ + prefix_wrap_simple(extl_add_searchdir, MODULEDIR); + prefix_wrap_simple(extl_add_searchdir, ETCDIR); #ifdef PWM_ETCDIR - extl_add_searchdir(PWM_ETCDIR); + prefix_wrap_simple(extl_add_searchdir, PWM_ETCDIR); #endif - extl_add_searchdir(SHAREDIR); - extl_add_searchdir(LCDIR); + prefix_wrap_simple(extl_add_searchdir, SHAREDIR); + prefix_wrap_simple(extl_add_searchdir, LCDIR); extl_set_userdirs("pwm3"); optparser_init(argc, argv, OPTP_MIDLONG, pwm_opts);