[pacman-dev] CVS update of pacman-lib/lib/libalpm (server.c)

Aaron Griffin aaron at archlinux.org
Tue May 8 04:11:59 EDT 2007


    Date: Tuesday, May 8, 2007 @ 04:11:59
  Author: aaron
    Path: /home/cvs-pacman/pacman-lib/lib/libalpm

Modified: server.c (1.28 -> 1.29)

minor: Remove trailing slashes from Server urls to prevent double slashes in
paths


----------+
 server.c |    5 +++++
 1 file changed, 5 insertions(+)


Index: pacman-lib/lib/libalpm/server.c
diff -u pacman-lib/lib/libalpm/server.c:1.28 pacman-lib/lib/libalpm/server.c:1.29
--- pacman-lib/lib/libalpm/server.c:1.28	Wed Mar 21 17:08:08 2007
+++ pacman-lib/lib/libalpm/server.c	Tue May  8 04:11:59 2007
@@ -72,6 +72,10 @@
 		strcpy(u->pwd, "libalpm at guest");
 	}
 
+	/* remove trailing slashes, just to clean up the rest of the code */
+	for(int i = strlen(u->doc) - 1; u->doc[i] == '/'; --i)
+		u->doc[i] = '\0';
+
   server->s_url = u;
 
 	return server;
@@ -126,6 +130,7 @@
 	}
 
 	snprintf(doc, doclen, "%s/%s", server->s_url->doc, filename);
+	_alpm_log(PM_LOG_DEBUG, "file path: '%s'", doc);
 	ret = downloadMakeURL(server->s_url->scheme,
 												server->s_url->host,
 												server->s_url->port,




More information about the pacman-dev mailing list