Index: net_db.cc =================================================================== RCS file: /cvsroot/squid/squid3/src/net_db.cc,v retrieving revision 1.6 diff -u -p -r1.6 net_db.cc --- net_db.cc 23 Jan 2003 03:14:42 -0000 1.6 +++ net_db.cc 4 Feb 2003 11:26:26 -0000 @@ -457,7 +457,11 @@ netdbReloadState(void) * Solaris bugs, its a bad idea. fopen can fail if more than * 256 FDs are open. */ +#ifdef _SQUID_MSWIN_ + fd = file_open(path, O_RDONLY | O_BINARY); +#else fd = file_open(path, O_RDONLY | O_TEXT); +#endif if (fd < 0) return; if (fstat(fd, &sb) < 0) { Index: errorpage.cc =================================================================== RCS file: /cvsroot/squid/squid3/src/errorpage.cc,v retrieving revision 1.9 diff -u -p -r1.9 errorpage.cc --- errorpage.cc 28 Jan 2003 03:13:08 -0000 1.9 +++ errorpage.cc 4 Feb 2003 11:26:27 -0000 @@ -194,7 +194,11 @@ errorTryLoadText(const char *page_name, char *text; snprintf(path, sizeof(path), "%s/%s", dir, page_name); +#ifdef _SQUID_MSWIN_ + fd = file_open(path, O_RDONLY | O_BINARY); +#else fd = file_open(path, O_RDONLY | O_TEXT); +#endif if (fd < 0 || fstat(fd, &sb) < 0) { debug(4, 0) ("errorTryLoadText: '%s': %s\n", path, xstrerror()); if (fd >= 0) @@ -209,8 +213,10 @@ errorTryLoadText(const char *page_name, text = NULL; } file_close(fd); - if (strstr(text, "%s") == NULL) - strcat(text, "%S"); /* add signature */ + if (text != NULL) { + if (strstr(text, "%s") == NULL) + strcat(text, "%S"); /* add signature */ + } return text; }