tGScanner under Win32 + GLib2 does appear to work properly with files now, so t… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 311dcdb73a679592df474f50244c595464999368 | |
parent 5840ac9f9788cc197aa9ddc02411d03bc96906ab | |
Author: Ben Webb <[email protected]> | |
Date: Mon, 26 Aug 2002 12:18:29 +0000 | |
GScanner under Win32 + GLib2 does appear to work properly with files now, | |
so the dodgy workaround code is removed. | |
Diffstat: | |
M src/dopewars.c | 18 +----------------- | |
1 file changed, 1 insertion(+), 17 deletions(-) | |
--- | |
diff --git a/src/dopewars.c b/src/dopewars.c | |
t@@ -1801,17 +1801,13 @@ void ScannerErrorHandler(GScanner *scanner, gchar *msg… | |
} | |
/* | |
- * Read a configuration file given by "FileName"; GScanner under Win32 | |
- * doesn't work properly with files, so we use a nasty workaround. | |
+ * Read a configuration file given by "FileName" | |
*/ | |
static gboolean ReadConfigFile(char *FileName, gchar **encoding) | |
{ | |
FILE *fp; | |
Converter *conv; | |
-#ifdef CYGWIN | |
- char *buf; | |
-#endif | |
GScanner *scanner; | |
fp = fopen(FileName, "r"); | |
t@@ -1823,16 +1819,7 @@ static gboolean ReadConfigFile(char *FileName, gchar **… | |
scanner = g_scanner_new(&ScannerConfig); | |
scanner->input_name = FileName; | |
scanner->msg_handler = ScannerErrorHandler; | |
-#ifdef CYGWIN | |
- read_string(fp, &buf); | |
- if (!buf) { | |
- fclose(fp); | |
- return TRUE; | |
- } | |
- g_scanner_input_text(scanner, buf, strlen(buf)); | |
-#else | |
g_scanner_input_file(scanner, fileno(fp)); | |
-#endif | |
while (!g_scanner_eof(scanner)) { | |
if (!ParseNextConfig(scanner, conv, encoding, FALSE)) { | |
ConfigErrors++; | |
t@@ -1844,9 +1831,6 @@ static gboolean ReadConfigFile(char *FileName, gchar **e… | |
g_scanner_destroy(scanner); | |
Conv_Free(conv); | |
fclose(fp); | |
-#ifdef CYGWIN | |
- g_free(buf); | |
-#endif | |
return TRUE; | |
} else { | |
return FALSE; |