X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=kernel%2Fmain.c;h=5c73fffef3233c39913da666f8f7b361b3616a8a;hb=3f2629f37040901a13e34fdfc13d69de0394e90f;hp=5ed778e088cedcb33f78aa36079ad97caec4bc68;hpb=aa975e8f85af258357639e3407ce40090f4a4998;p=egate.git diff --git a/kernel/main.c b/kernel/main.c index 5ed778e..5c73fff 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -45,7 +45,10 @@ * Europagate, 1995 * * $Log: main.c,v $ - * Revision 1.27 1995/05/19 13:25:59 adam + * Revision 1.28 1995/07/03 08:20:15 adam + * More help information and better diagnostics. + * + * Revision 1.27 1995/05/19 13:25:59 adam * Bug fixes. Better command line options. * * Revision 1.26 1995/05/18 12:03:08 adam @@ -505,8 +508,6 @@ static int fml_inf_read (void) void read_kernel_res (void) { - char path_prefix[128]; - char fname[160]; const char *v; char *cp; char resource_name[256]; @@ -537,23 +538,19 @@ void read_kernel_res (void) info.default_res); return; } - strcpy (path_prefix, gw_res_get (info.kernel_res, "gw.path", ".")); - /* fetch target definitions (if defined at all) */ if (*info.target) { sprintf (resource_name, "gw.target.%s", info.target); v = gw_res_get (info.kernel_res, resource_name, NULL); if (v) - { - sprintf (fname, "%s/%s", path_prefix, v); - gw_res_merge (info.kernel_res, fname); - } + gw_res_merge (info.kernel_res, v); } /* fetch user definitions (if user-id is specified) */ if (info.userid >= 0) { - sprintf (fname, "%s/user.%d.r", path_prefix, info.userid); + char fname[250]; + sprintf (fname, "user.%d.r", info.userid); gw_res_merge (info.kernel_res, fname); } /* fetch language definitions (if specified at all) */ @@ -564,18 +561,14 @@ void read_kernel_res (void) v = gw_res_get (info.kernel_res, resource_name, NULL); if (v) { - sprintf (fname, "%s/%s", path_prefix, v); gw_log (GW_LOG_DEBUG, KERNEL_LOG, "Reading language resources %s", - fname); - gw_res_merge (info.kernel_res, fname); + v); + gw_res_merge (info.kernel_res, v); } } /* fetch overriding resources from file (if specified) */ if (info.override_res) - { - sprintf (fname, "%s/%s", path_prefix, info.override_res); - gw_res_merge (info.kernel_res, fname); - } + gw_res_merge (info.kernel_res, info.override_res); /* read bibset definition for ccl */ v = gw_res_get (info.kernel_res, "gw.bibset", NULL); @@ -583,13 +576,12 @@ void read_kernel_res (void) { FILE *bib_inf; - sprintf (fname, "%s/%s", path_prefix, v); - bib_inf = fopen (fname, "r"); + bib_inf = fopen (v, "r"); if (!bib_inf) - gw_log (GW_LOG_WARN, KERNEL_LOG, "cannot open %s", fname); + gw_log (GW_LOG_WARN, KERNEL_LOG, "cannot open %s", v); else { - gw_log (GW_LOG_DEBUG, KERNEL_LOG, "reading bib file %s", fname); + gw_log (GW_LOG_DEBUG, KERNEL_LOG, "reading bib file %s", v); ccl_qual_file (info.bibset, bib_inf); fclose (bib_inf); } @@ -674,11 +666,9 @@ void read_kernel_res (void) if (!info.fml) { v = gw_res_get (info.kernel_res, "gw.fml", "default.fml"); - sprintf (fname, "%s/%s", path_prefix, v); - fml_inf = fopen (fname, "r"); + fml_inf = fopen (v, "r"); if (!fml_inf) - gw_log (GW_LOG_WARN, KERNEL_LOG, - "cannot open fml script %s", fname); + gw_log (GW_LOG_WARN, KERNEL_LOG, "cannot open fml script %s", v); else { info.fml = fml_open ();