FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 01-09-2012, 06:21 PM
jjacky
 
Default Only create string when needed (libalpm)

The entry's name is only used when not "." or ".." so only
print the string then.

Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com>
---
lib/libalpm/util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index e2cbd8c..4245039 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -427,8 +427,8 @@ int _alpm_rmrf(const char *path)
}
for(dp = readdir(dirp); dp != NULL; dp =
readdir(dirp)) {

if(dp->d_ino) {
- sprintf(name, "%s/%s", path,
dp->d_name);
if(strcmp(dp->d_name, "..") !=
0 && strcmp(dp->d_name, ".") != 0) {
+ sprintf(name, "%s/%s",
path, dp->d_name);
errflag +=
_alpm_rmrf(name);

}
}
--
1.7.8.3
 
Old 01-09-2012, 07:37 PM
jjacky
 
Default Only create string when needed (libalpm)

The entry's name is only used when not "." or ".." so
only print the string then.

Signed-off-by: Olivier Brunel <i.am.jack.mail@gmail.com>
---
lib/libalpm/util.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index e2cbd8c..4245039 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -427,8 +427,8 @@ int _alpm_rmrf(const char *path)
}
for(dp = readdir(dirp); dp != NULL; dp = readdir(dirp)) {
if(dp->d_ino) {
- sprintf(name, "%s/%s", path, dp->d_name);
if(strcmp(dp->d_name, "..") != 0 && strcmp(dp->d_name, ".") != 0) {
+ sprintf(name, "%s/%s", path, dp->d_name);
errflag += _alpm_rmrf(name);
}
}
--
1.7.8.3
 

Thread Tools




All times are GMT. The time now is 01:41 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org