summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/util.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-01-23 19:19:51 +0100
committerDan McGee <dan@archlinux.org>2012-01-23 19:20:52 +0100
commite50c4a8837cedf47c2fe1a2c6064b4dc03dc5b03 (patch)
treedf2e33d95d02b17e5d720320c19e267893d68bdf /lib/libalpm/util.c
parentb3612e9cc198f198b3806efa461bf6fc04dd4502 (diff)
parent825b4ff35aa676b139dc24bc651724b092f2fded (diff)
downloadpacman-e50c4a8837cedf47c2fe1a2c6064b4dc03dc5b03.tar.gz
pacman-e50c4a8837cedf47c2fe1a2c6064b4dc03dc5b03.tar.xz
Merge branch 'maint'
Conflicts: lib/libalpm/diskspace.c src/pacman/util.h
Diffstat (limited to 'lib/libalpm/util.c')
-rw-r--r--lib/libalpm/util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index e2cbd8c5..3cc4bbf7 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -1,7 +1,7 @@
/*
* util.c
*
- * Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org>
+ * Copyright (c) 2006-2012 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2005 by Christian Hamar <krics@linuxforum.hu>
@@ -406,7 +406,6 @@ int _alpm_rmrf(const char *path)
int errflag = 0;
struct dirent *dp;
DIR *dirp;
- char name[PATH_MAX];
struct stat st;
if(_alpm_lstat(path, &st) == 0) {
@@ -426,9 +425,10 @@ int _alpm_rmrf(const char *path)
return 1;
}
for(dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
- if(dp->d_ino) {
- sprintf(name, "%s/%s", path, dp->d_name);
+ if(dp->d_name) {
if(strcmp(dp->d_name, "..") != 0 && strcmp(dp->d_name, ".") != 0) {
+ char name[PATH_MAX];
+ sprintf(name, "%s/%s", path, dp->d_name);
errflag += _alpm_rmrf(name);
}
}
@@ -1168,7 +1168,7 @@ off_t _alpm_strtoofft(const char *line)
errno = 0;
/* we are trying to parse bare numbers only, no leading anything */
- if(line[0] < '0' || line[0] > '9') {
+ if(!isdigit((unsigned char)line[0])) {
return (off_t)-1;
}
result = strtoull(line, &end, 10);