Remove double "//" when listing attributes in the root directory or

when there is a trailing '/' in the directory name.  (Addresses Debian
Bug #272943)
bitmap-optimize
Theodore Ts'o 2004-09-24 12:16:17 -04:00
parent 6ea8d0f7c8
commit 137ce8ca04
3 changed files with 13 additions and 3 deletions

4
debian/changelog vendored
View File

@ -1,12 +1,14 @@
e2fsprogs (1.35-8) unstable; urgency=low
* Remove double "//" when listing attributes in the root directory or
when there is a trailing '/' in the directory name. (Closes: #272943)
* Make sure the configure files are newer than configure.in the
debian/rules file so that a dpkg-source created patch won't
trigger an attempt rebuild of the configure script. (Closes: #272558)
* Make sure /usr/lib/e2initrd_helper is in the e2fsprogs package.
(Closes: #272698)
-- Theodore Y. Ts'o <tytso@mit.edu> Fri, 24 Sep 2004 11:51:36 -0400
-- Theodore Y. Ts'o <tytso@mit.edu> Fri, 24 Sep 2004 12:12:44 -0400
e2fsprogs (1.35-7) unstable; urgency=low

View File

@ -1,5 +1,9 @@
2004-09-24 Theodore Ts'o <tytso@mit.edu>
* lsattr.c (lsattr_dir_proc): Avoid double // when listing the
root directory, or when there is a trailing '/' in the
directory name. (Addresses Debian Bug #272943)
* Makefile.in: Make sure /usr/lib is created for when we install
e2initrd_helper.

View File

@ -125,10 +125,14 @@ static int lsattr_dir_proc (const char * dir_name, struct dirent * de,
{
STRUCT_STAT st;
char *path;
int dir_len = strlen(dir_name);
path = malloc(strlen (dir_name) + 1 + strlen (de->d_name) + 1);
path = malloc(dir_len + strlen (de->d_name) + 2);
sprintf (path, "%s/%s", dir_name, de->d_name);
if (dir_len && dir_name[dir_len-1] == '/')
sprintf (path, "%s%s", dir_name, de->d_name);
else
sprintf (path, "%s/%s", dir_name, de->d_name);
if (LSTAT (path, &st) == -1)
perror (path);
else {