summaryrefslogtreecommitdiff
path: root/src/util/testdb.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-10-31 11:43:04 -0500
committerDan McGee <dan@archlinux.org>2007-11-04 09:50:43 -0600
commitdea9b3bc0f6ba49aec8452958f5373fbb20e7df2 (patch)
treeb06f792e4d258b0ca69a0fb373d40c2eacee6b2e /src/util/testdb.c
parent4a5e7b6bd1a887f67b9b9ec8115250fc92c741ca (diff)
downloadpacman-dea9b3bc0f6ba49aec8452958f5373fbb20e7df2.tar.xz
Fix basename usage in pacman and utilities
basename() is a rather untrusty function call on a lot of platforms as it does some weird and different things. To solve this, I added a mbasename fuction to pacman to take its place, and simply removed its usage in the utilities (it isn't worth dealing with there). Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/util/testdb.c')
-rw-r--r--src/util/testdb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/testdb.c b/src/util/testdb.c
index a06456a4..421a553c 100644
--- a/src/util/testdb.c
+++ b/src/util/testdb.c
@@ -32,6 +32,8 @@
#include <alpm.h>
#include <alpm_list.h>
+#define BASENAME "testdb"
+
int str_cmp(const void *s1, const void *s2)
{
return(strcmp(s1, s2));
@@ -145,7 +147,7 @@ int main(int argc, char **argv)
} else if(argc == 3 && strcmp(argv[1], "-b") == 0) {
dbpath = argv[2];
} else {
- fprintf(stderr, "usage: %s -b <pacman db>\n", basename(argv[0]));
+ fprintf(stderr, "usage: %s -b <pacman db>\n", BASENAME);
return(1);
}