diff --git a/src/Makefile.win32 b/src/Makefile.win32 index 74259e40..eb6a8e96 100644 --- a/src/Makefile.win32 +++ b/src/Makefile.win32 @@ -74,3 +74,4 @@ clean: del /F pacparser.dll *.lib pacparser.def pacparser.exp pacparser.o pactester.exe libpacparser.a $(MAKE) -C spidermonkey -f Makefile.win32 clean cd pymod && setup.py clean + if exist dist rmdir /s /q dist diff --git a/src/pacparser.c b/src/pacparser.c index fca87a8a..7dc23845 100644 --- a/src/pacparser.c +++ b/src/pacparser.c @@ -98,6 +98,9 @@ resolve_host(const char *hostname, char *ipaddr_list, int max_results) char ipaddr[INET6_ADDRSTRLEN]; int error; + // Truncate ipaddr_list to an empty string. + ipaddr_list[0] = '\0'; + #ifdef _WIN32 // On windows, we need to initialize the winsock dll first. WSADATA WsaData; @@ -118,7 +121,7 @@ resolve_host(const char *hostname, char *ipaddr_list, int max_results) if (ipaddr_list[0] == '\0') sprintf(ipaddr_list, "%s", ipaddr); else sprintf(ipaddr_list, "%s;%s", ipaddr_list, ipaddr); } - freeaddrinfo(ai); + freeaddrinfo(result); #ifdef _WIN32 WSACleanup(); #endif diff --git a/src/pymod/Makefile.win32 b/src/pymod/Makefile.win32 index 6c1645f6..8606619d 100644 --- a/src/pymod/Makefile.win32 +++ b/src/pymod/Makefile.win32 @@ -65,5 +65,5 @@ dist: build copy ..\..\INSTALL dist\INSTALL.txt clean: - if exist pacparser_py.o del pacparser_py.o - if exist _pacparser.pyd del _pacparser.pyd + del /F pacparser_py.o _pacparser.pyd + if exist dist rmdir /s /q dist diff --git a/tests/proxy.pac b/tests/proxy.pac index 50fa3455..866eb9a9 100644 --- a/tests/proxy.pac +++ b/tests/proxy.pac @@ -29,9 +29,6 @@ function FindProxyForURL(url, host) { if (/^https:\/\/.*$/.test(url)) return "secureUrl"; - if (isInNet(myIpAddress(), '192.0.0.0', '255.0.0.0')) - return '192.0.0.0'; - if (isInNet(myIpAddress(), '10.10.0.0', '255.255.0.0')) return '10.10.0.0'; diff --git a/tests/testdata b/tests/testdata index 4a46815a..de9a9efe 100644 --- a/tests/testdata +++ b/tests/testdata @@ -1,5 +1,5 @@ # Command Line Parameters|Expected Result --u http://www.google.co.in|END-OF-SCRIPT +-c 0.0.0.0 -u http://www.google.co.in|END-OF-SCRIPT -e -u http://www.google.com|dnsResolveEx defined -u http://host1|plainhost/.manugarg.com -u http://www1.manugarg.com|plainhost/.manugarg.com @@ -7,5 +7,4 @@ -u http://www.google.com|isResolvable -u http://www.notresolvabledomainXXX.com|isNotResolvable -u https://www.somehost.com|secureUrl --c 192.168.101.1 -u http://www.somehost.com|192.0.0.0 -c 10.10.100.112 -u http://www.somehost.com|10.10.0.0