X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ion%2Fion.c;h=4bbfb60f58707727ed025316a7011fb42d1a3126;hb=20080103;hp=1c7fcf97dcda3faca0591fb6794cea169907453c;hpb=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d;p=ion3.git diff --git a/ion/ion.c b/ion/ion.c index 1c7fcf9..4bbfb60 100644 --- a/ion/ion.c +++ b/ion/ion.c @@ -1,12 +1,9 @@ /* * ion/ion/ion.c * - * Copyright (c) Tuomo Valkonen 1999-2007. + * Copyright (c) Tuomo Valkonen 1999-2008. * - * 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 @@ -129,7 +127,7 @@ void check_new_user_help() static void help() { int i; - printf(TR("Usage: %s [options]\n\n"), prog_execname()); + printf(TR("Usage: %s [options]\n\n"), libtu_progname()); for(i=0; ion_opts[i].descr!=NULL; i++) ion_opts[i].descr=TR(ion_opts[i].descr); optparser_printhelp(OPTP_MIDLONG, ion_opts); @@ -149,17 +147,27 @@ 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("ion3", argc, argv, LOCALEDIR)) + +#ifdef CF_RELOCATABLE_ION3_LOCATION + prefix_set(argv[0], CF_RELOCATABLE_ION3_LOCATION); +#endif + + localedir=prefix_add(LOCALEDIR); + + if(!ioncore_init("ion3", argc, argv, localedir)) return EXIT_FAILURE; + + if(localedir!=NULL) + free(localedir); - extl_add_searchdir(EXTRABINDIR); /* ion-completefile */ - extl_add_searchdir(MODULEDIR); - extl_add_searchdir(ETCDIR); - extl_add_searchdir(SHAREDIR); - extl_add_searchdir(LCDIR); + prefix_wrap_simple(extl_add_searchdir, EXTRABINDIR); /* ion-completefile */ + prefix_wrap_simple(extl_add_searchdir, MODULEDIR); + prefix_wrap_simple(extl_add_searchdir, ETCDIR); + prefix_wrap_simple(extl_add_searchdir, SHAREDIR); + prefix_wrap_simple(extl_add_searchdir, LCDIR); extl_set_userdirs("ion3"); optparser_init(argc, argv, OPTP_MIDLONG, ion_opts); @@ -240,7 +248,7 @@ fail: fclose(ef); pid=fork(); if(pid==0){ - ioncore_setup_environ(DefaultScreen(ioncore_g.dpy)); + ioncore_setup_display(DefaultScreen(ioncore_g.dpy)); if(!may_continue) XCloseDisplay(ioncore_g.dpy); else