Ignore:
Timestamp:
2003-06-13T12:24:12+12:00 (21 years ago)
Author:
sjboddie
Message:

Added command line arguments to server.exe so the GLI can tell it to use
an alternative config file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/w32server/settings.cpp

    r4339 r4642  
    2727
    2828#include "text_t.h"
     29#include "fileutil.h"
    2930
    3031#if defined(GSDL_USE_OBJECTSPACE)
     
    6364char gsdl_browser_exe[MAX_FILENAME_SIZE] = "";
    6465text_t gsdl_url;
     66text_t gsdl_conffile;
    6567int gsdl_start_browser = 1;
    6668
     
    269271
    270272void write_settings (const text_t url) {
    271   char conffile[MAX_FILENAME_SIZE];
    272  
    273   strcpy (conffile, data_location);
    274   remove_end_slashes (conffile);
    275   strcat (conffile, "\\gsdlsite.cfg");
    276  
    277   ofstream fout (conffile);
     273 
     274  if (gsdl_conffile.empty()) {
     275    find_location();
     276    gsdl_conffile = filename_cat(data_location, "gsdlsite.cfg");
     277  }
     278
     279  char *conffile_c = gsdl_conffile.getcstr();
     280  ofstream fout (conffile_c);
     281  delete conffile_c;
    278282  if (fout) {
    279283   
     
    397401
    398402void read_settings (int netscapeneeded) {
    399   char conffile[MAX_FILENAME_SIZE];
    400  
    401   find_location();
    402  
    403   strcpy (conffile, data_location);
    404   remove_end_slashes (conffile);
    405   strcat (conffile, "\\gsdlsite.cfg");
     403 
     404  if (gsdl_conffile.empty()) {
     405    find_location();
     406    gsdl_conffile = filename_cat(data_location, "gsdlsite.cfg");
     407  }
    406408 
    407409  // set up defaults
     
    410412  text_t key, value, section;
    411413  char *cstr_value;
     414  char *conffile_c = gsdl_conffile.getcstr();
    412415#if defined (GSDL_USE_IOS_H)
    413   ifstream conf (conffile, ios::nocreate);
     416  ifstream conf (conffile_c, ios::nocreate);
    414417#else
    415   ifstream conf (conffile);
     418  ifstream conf (conffile_c);
    416419#endif
     420  delete conffile_c;
    417421  if (conf) {
    418422    while (read_ini_line(conf, key, value) >= 0) {
Note: See TracChangeset for help on using the changeset viewer.