]> jfr.im git - irc/gameservirc.git/commitdiff
Fixed the config.cpp so that it was more lenient with blank lines in the gameserv...
authorkainazzzo <redacted>
Thu, 30 Oct 2003 17:58:17 +0000 (17:58 +0000)
committerkainazzzo <redacted>
Thu, 30 Oct 2003 17:58:17 +0000 (17:58 +0000)
git-svn-id: https://svn.code.sf.net/p/gameservirc/code/trunk@45 bc333340-6410-0410-a689-9d09f3c113fa

gameserv/config.cpp
gameserv/configscript.cpp
gameserv/gameserv.cpp
gameserv/tcpclient.cpp

index fcc004c00e935be55b95951f1eb6f764e8b8408b..8e3b35998c0de61f4a10a5abcaa452a034ee8d25 100644 (file)
@@ -5,8 +5,6 @@
 
 void load_config_file(char *config);
 void unload_config_file();
-int stricmp(const char *s1, const char *s2);
-int strnicmp(const char *s1, const char *s2, size_t len);
 
 /* Random Configuration Stuff Goes Here until I code it to load from a .conf file :)*/
 
@@ -63,7 +61,7 @@ void load_config_file(char *config)
     infile.open(config);
     if (infile.fail())
     {
-       cerr << "Error opening " << config << endl;
+       cout << "Error opening " << config << endl;
        return;
     }
 
@@ -71,7 +69,7 @@ void load_config_file(char *config)
     {
        cout << "Buf: " << buf << endl;
 
-       if (buf[0] == '#' || buf[0] == ' ' || buf[0] == '\0')
+       if (buf[0] == '#' || buf[0] == ' ' || buf[0] == '\0' || buf[0] == '\n' || buf[0] == '\r')
            continue;
        
        directive = strtok(buf, " ");
@@ -144,10 +142,9 @@ void load_config_file(char *config)
        }
        else
        {
-           cerr << "Unknown Directive. Buffer: " << buf << endl;
+           cout << "Unknown Directive. Buffer: " << buf << endl;
            continue;
        }
-       //infile.ignore(1);
     }
 delete [] buf;
 infile.close();
index 2f9313b097433efb52a142b2b530d07b21e49a0c..bcb08ea2d7664f89c17f0e07b26b24f9665892a8 100644 (file)
@@ -1,7 +1,6 @@
 #include <fstream>
 #include <iostream>
 
-using std::cerr;
 using std::cout;
 using std::ofstream;
 
@@ -14,7 +13,7 @@ int main()
     outfile.open("options.h");
     if (outfile.fail())
     {
-       cerr << "Error opening options.h" << endl;
+       cout << "Error opening options.h" << endl;
        return 1;
     }
     char c = 0;
index dcef785c02b75cd1a2ace0ffcd43461098a252f2..0dafb9e62c640afe06390fc022f320cd48f92f89 100644 (file)
@@ -2478,7 +2478,7 @@ int save_gs_dbase()
 
     if (!outfile)
     {
-       cerr << "Error opening " << playerdata << endl;
+       cout << "Error opening " << playerdata << endl;
        return 0;
     }
 
@@ -2508,7 +2508,7 @@ int load_gs_dbase()
 
     if (infile.fail())
     {
-       cerr << "Error opening " << playerdata << endl;
+       cout << "Error opening " << playerdata << endl;
        return 0;
     }
 
index db18a67586a6860b40a72d84cda7ad3053784094..7f4364462905da385cf2930c5883162800e949c3 100644 (file)
@@ -250,8 +250,8 @@ void load_timestamp()
 
     if (infile.fail())
     {
-       cerr << "Error opening .gstimestamp" << endl;
-       cerr << "Generating new timestamp" << endl;
+       cout << "Error opening .gstimestamp" << endl;
+       cout << "Generating new timestamp" << endl;
        generate:
        timestamp = midnight();
         save_timestamp();
@@ -272,7 +272,7 @@ void save_timestamp()
 
     if (outfile.fail())
     {
-       cerr << "Error creating new file." << endl;
+       cout << "Error creating new file." << endl;
        return;
     }