Ticket #3464: mc-3464-cleanup-compute_namelen.patch
File mc-3464-cleanup-compute_namelen.patch, 2.0 KB (added by and, 10 years ago) |
---|
-
lib/fs.h
remove unneeded compute_namelen() function always DIRENT_LENGTH_COMPUTED 1 -> compute_namelen() returns without functional logic Signed-off-by: Andreas Mohr <and@gmx.li>
a b 100 100 101 101 /* unistd.h defines _POSIX_VERSION on POSIX.1 systems. */ 102 102 #define NLENGTH(dirent) (strlen ((dirent)->d_name)) 103 #define DIRENT_LENGTH_COMPUTED 1104 103 105 104 /* DragonFlyBSD doesn't provide MAXNAMLEN macro */ 106 105 #ifndef MAXNAMLEN … … 122 121 123 122 /*** inline functions ****************************************************************************/ 124 123 125 static inline void126 compute_namelen (struct dirent *dent __attribute__ ((unused)))127 {128 #ifdef DIRENT_LENGTH_COMPUTED129 (void) dent;130 return;131 #else132 dent->d_namlen = strlen (dent);133 #endif134 }135 136 124 #endif -
lib/vfs/direntry.c
a b 448 448 else 449 449 vfs_die ("Null in structure-cannot happen"); 450 450 451 compute_namelen (&dir.dent);452 451 info->cur = g_list_next (info->cur); 453 452 454 453 return (void *) &dir; -
src/vfs/extfs/extfs.c
a b 1061 1061 1062 1062 g_strlcpy (dir.dent.d_name, (*info)->name, MC_MAXPATHLEN); 1063 1063 1064 compute_namelen (&dir.dent);1065 1064 *info = (*info)->next_in_dir; 1066 1065 1067 1066 return (void *) &dir; -
src/vfs/sftpfs/dir.c
a b 149 149 return NULL; 150 150 151 151 g_strlcpy (sftpfs_dirent.dent.d_name, mem, BUF_MEDIUM); 152 compute_namelen (&sftpfs_dirent.dent);153 152 return &sftpfs_dirent; 154 153 } 155 154 -
src/vfs/smbfs/smbfs.c
a b 939 939 g_strlcpy (dirent_dest, smbfs_info->current->text, MC_MAXPATHLEN); 940 940 smbfs_info->current = smbfs_info->current->next; 941 941 942 compute_namelen (&smbfs_readdir_data.dent);943 944 942 return &smbfs_readdir_data; 945 943 } 946 944 -
src/vfs/undelfs/undelfs.c
a b 414 414 (long) delarray[readdir_ptr].ino, delarray[readdir_ptr].num_blocks); 415 415 readdir_ptr++; 416 416 417 compute_namelen (&undelfs_readdir_data.dent);418 419 417 return &undelfs_readdir_data; 420 418 } 421 419