libproxy/libproxy-gcc45.patch
Dominique Leuenberger 4e8ac19230 Accepting request 34204 from home:dimstar:branches:GNOME:Factory
Copy from home:dimstar:branches:GNOME:Factory/libproxy via accept of submit request 34204 revision 2.
Request was accepted with message:
Forwarding to openSUSE:Factory

OBS-URL: https://build.opensuse.org/request/show/34204
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/libproxy?expand=0&rev=36
2010-03-06 19:20:10 +00:00

69 lines
3.4 KiB
Diff

Index: libproxy/url.cpp
===================================================================
--- libproxy/url.cpp.orig
+++ libproxy/url.cpp
@@ -95,11 +95,11 @@ url::url(const string url) throw(parse_e
// Break apart our url into 4 sections: scheme, auth (user/pass), host and path
// We'll do further parsing of auth and host a bit later
// NOTE: reset the unused variable after each scan or we get bleed-through
- if (sscanf(url.c_str(), "%[^:]://%[^@]@%[^/]/%s", schm, auth, host, path) != 4 && !((*path = NULL)) && // URL with auth, host and path
- sscanf(url.c_str(), "%[^:]://%[^@]@%[^/]", schm, auth, host) != 3 && !((*auth = NULL)) && // URL with auth, host
- sscanf(url.c_str(), "%[^:]://%[^/]/%s", schm, host, path) != 3 && !((*path = NULL)) && // URL with host, path
- sscanf(url.c_str(), "%[^:]://%[^/]", schm, host) != 2 && !((*host = NULL)) && // URL with host
- !(sscanf(url.c_str(), "%[^:]://%s", schm, path) == 2 && string("file") == schm) && !((*path = NULL)) && // URL with path (ex: file:///foo)
+ if (sscanf(url.c_str(), "%[^:]://%[^@]@%[^/]/%s", schm, auth, host, path) != 4 && !((*path = '\0')) && // URL with auth, host and path
+ sscanf(url.c_str(), "%[^:]://%[^@]@%[^/]", schm, auth, host) != 3 && !((*auth = '\0')) && // URL with auth, host
+ sscanf(url.c_str(), "%[^:]://%[^/]/%s", schm, host, path) != 3 && !((*path = '\0')) && // URL with host, path
+ sscanf(url.c_str(), "%[^:]://%[^/]", schm, host) != 2 && !((*host = '\0')) && // URL with host
+ !(sscanf(url.c_str(), "%[^:]://%s", schm, path) == 2 && string("file") == schm) && !((*path = '\0')) && // URL with path (ex: file:///foo)
!(sscanf(url.c_str(), "%[^:]://", schm) == 1 && (string("direct") == schm || string("wpad") == schm))) // URL with scheme-only (ex: wpad://, direct://)
{
delete schm;
@@ -112,8 +112,8 @@ url::url(const string url) throw(parse_e
// Set scheme and path
this->scheme = schm;
this->path = *path ? string("/") + path : "";
- *schm = NULL;
- *path = NULL;
+ *schm = '\0';
+ *path = '\0';
// Parse auth further
if (*auth) {
@@ -122,7 +122,7 @@ url::url(const string url) throw(parse_e
this->pass = this->user.substr(this->user.find(":")+1);
this->user = this->user.substr(0, this->user.find(":"));
}
- *auth = NULL;
+ *auth = '\0';
}
// Parse host further. Basically, we're looking for a port.
@@ -142,7 +142,7 @@ url::url(const string url) throw(parse_e
}
this->host = host;
- *host = NULL;
+ *host = '\0';
}
// Cleanup
@@ -235,7 +235,7 @@ sockaddr const* const* url::get_ips(bool
// Check DNS for IPs
struct addrinfo* info;
struct addrinfo flags;
- memset(&flags, NULL, sizeof(addrinfo));
+ memset(&flags, '\0', sizeof(addrinfo));
flags.ai_family = AF_UNSPEC;
flags.ai_socktype = 0;
flags.ai_protocol = 0;
@@ -254,7 +254,7 @@ sockaddr const* const* url::get_ips(bool
// Create our array since we actually have a result
this->ips = new sockaddr*[++i];
- memset(this->ips, NULL, sizeof(sockaddr*)*i);
+ memset(this->ips, '\0', sizeof(sockaddr*)*i);
// Copy the sockaddr's into this->ips
for (i = 0, info = first ; info ; info = info->ai_next) {