From 278ae44436f312ee4c91107f1293b9c41c0bf66a Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Mon, 27 Dec 2004 12:12:31 +0000 Subject: [PATCH] * extfs.c (extfs_generate_entry): Initialize inode->last_in_subdir. (extfs_read_archive): Likewise. Remove unneeded test. Fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=286990 * extfs/ulha.in (mc_lha_fs_list): Use $NF instead of $10 as filename for permission intention. Fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=286990 --- vfs/ChangeLog | 10 ++++++++++ vfs/extfs.c | 16 ++++++++-------- vfs/extfs/ulha.in | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 8098d4676..6693a7418 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,13 @@ +2004-12-27 Andrew V. Samoilov + + * extfs.c (extfs_generate_entry): Initialize inode->last_in_subdir. + (extfs_read_archive): Likewise. Remove unneeded test. + Fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=286990 + + * extfs/ulha.in (mc_lha_fs_list): Use $NF instead of $10 as filename + for permission intention. + Fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=286990 + 2004-12-10 Roland Illig * extfs/uzip.in: Fix handling of archive member pathnames starting diff --git a/vfs/extfs.c b/vfs/extfs.c index b013f450b..ebd1de67b 100644 --- a/vfs/extfs.c +++ b/vfs/extfs.c @@ -132,10 +132,9 @@ static void extfs_make_dots (struct entry *ent) entry->dir = ent; inode->local_filename = NULL; inode->first_in_subdir = entry; - inode->last_in_subdir = entry; inode->nlink++; entry->next_in_dir = g_new (struct entry, 1); - entry=entry->next_in_dir; + entry = entry->next_in_dir; entry->name = g_strdup (".."); inode->last_in_subdir = entry; entry->next_in_dir = NULL; @@ -170,7 +169,8 @@ static struct entry *extfs_generate_entry (struct archive *archive, inode = g_new (struct inode, 1); entry->inode = inode; inode->local_filename = NULL; - inode->linkname = 0; + inode->linkname = NULL; + inode->last_in_subdir = NULL; inode->inode = (archive->inode_counter)++; inode->dev = archive->rdev; inode->archive = archive; @@ -351,11 +351,9 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc) entry->name = g_strdup (p); entry->next_in_dir = NULL; entry->dir = pent; - if (pent != NULL) { - if (pent->inode->last_in_subdir) { - pent->inode->last_in_subdir->next_in_dir = entry; - pent->inode->last_in_subdir = entry; - } + if (pent->inode->last_in_subdir) { + pent->inode->last_in_subdir->next_in_dir = entry; + pent->inode->last_in_subdir = entry; } if (!S_ISLNK (hstat.st_mode) && current_link_name != NULL) { pent = @@ -392,6 +390,8 @@ extfs_read_archive (int fstype, const char *name, struct archive **pparc) inode->mtime = hstat.st_mtime; inode->atime = hstat.st_atime; inode->ctime = hstat.st_ctime; + inode->first_in_subdir = NULL; + inode->last_in_subdir = NULL; if (current_link_name != NULL && S_ISLNK (hstat.st_mode)) { inode->linkname = current_link_name; diff --git a/vfs/extfs/ulha.in b/vfs/extfs/ulha.in index d62132c6f..0b5735cb2 100644 --- a/vfs/extfs/ulha.in +++ b/vfs/extfs/ulha.in @@ -46,7 +46,7 @@ mc_lha_fs_list() # Print the line this way if there is no permission string $1 ~ /^\[.*\]/ { # Invent a generic permission - $1 = ($10 ~ /\/$/) ? "drwxr-xr-x":"-rwxr--r--"; + $1 = ($NF ~ /\/$/) ? "drwxr-xr-x":"-rwxr--r--"; # Print it printf "%s 1 %-8s %-8s %-8d %s %s %s %s\n", $1, uid, gid, $2, $4, $5, $6, $7;