aboutsummaryrefslogtreecommitdiff
path: root/e2fsprogs/e2fs_lib.c
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2006-12-26 03:02:25 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2006-12-26 03:02:25 +0000
commit407b8c0b7001b60f79181d62eb57e810f75e0e27 (patch)
tree6e5f5deaf078428c84a279cccd2cf9567e79e486 /e2fsprogs/e2fs_lib.c
parent0de9375ee6e766cf15942c6582c79b0ac6d310f5 (diff)
downloadbusybox-407b8c0b7001b60f79181d62eb57e810f75e0e27.tar.gz
busybox-407b8c0b7001b60f79181d62eb57e810f75e0e27.tar.bz2
trivial size reduction
Diffstat (limited to 'e2fsprogs/e2fs_lib.c')
-rw-r--r--e2fsprogs/e2fs_lib.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/e2fsprogs/e2fs_lib.c b/e2fsprogs/e2fs_lib.c
index cdf97352a..ea5c8026c 100644
--- a/e2fsprogs/e2fs_lib.c
+++ b/e2fsprogs/e2fs_lib.c
@@ -143,31 +143,31 @@ int fgetsetflags(const char *name, unsigned long *get_flags, unsigned long set_f
/* Print file attributes on an ext2 file system */
struct flags_name {
unsigned long flag;
- const char *short_name;
+ char short_name;
const char *long_name;
};
static const struct flags_name flags_array[] = {
- { EXT2_SECRM_FL, "s", "Secure_Deletion" },
- { EXT2_UNRM_FL, "u" , "Undelete" },
- { EXT2_SYNC_FL, "S", "Synchronous_Updates" },
- { EXT2_DIRSYNC_FL, "D", "Synchronous_Directory_Updates" },
- { EXT2_IMMUTABLE_FL, "i", "Immutable" },
- { EXT2_APPEND_FL, "a", "Append_Only" },
- { EXT2_NODUMP_FL, "d", "No_Dump" },
- { EXT2_NOATIME_FL, "A", "No_Atime" },
- { EXT2_COMPR_FL, "c", "Compression_Requested" },
+ { EXT2_SECRM_FL, 's', "Secure_Deletion" },
+ { EXT2_UNRM_FL, 'u' , "Undelete" },
+ { EXT2_SYNC_FL, 'S', "Synchronous_Updates" },
+ { EXT2_DIRSYNC_FL, 'D', "Synchronous_Directory_Updates" },
+ { EXT2_IMMUTABLE_FL, 'i', "Immutable" },
+ { EXT2_APPEND_FL, 'a', "Append_Only" },
+ { EXT2_NODUMP_FL, 'd', "No_Dump" },
+ { EXT2_NOATIME_FL, 'A', "No_Atime" },
+ { EXT2_COMPR_FL, 'c', "Compression_Requested" },
#ifdef ENABLE_COMPRESSION
- { EXT2_COMPRBLK_FL, "B", "Compressed_File" },
- { EXT2_DIRTY_FL, "Z", "Compressed_Dirty_File" },
- { EXT2_NOCOMPR_FL, "X", "Compression_Raw_Access" },
- { EXT2_ECOMPR_FL, "E", "Compression_Error" },
+ { EXT2_COMPRBLK_FL, 'B', "Compressed_File" },
+ { EXT2_DIRTY_FL, 'Z', "Compressed_Dirty_File" },
+ { EXT2_NOCOMPR_FL, 'X', "Compression_Raw_Access" },
+ { EXT2_ECOMPR_FL, 'E', "Compression_Error" },
#endif
- { EXT3_JOURNAL_DATA_FL, "j", "Journaled_Data" },
- { EXT2_INDEX_FL, "I", "Indexed_direcctory" },
- { EXT2_NOTAIL_FL, "t", "No_Tailmerging" },
- { EXT2_TOPDIR_FL, "T", "Top_of_Directory_Hierarchies" },
- { 0, NULL, NULL }
+ { EXT3_JOURNAL_DATA_FL, 'j', "Journaled_Data" },
+ { EXT2_INDEX_FL, 'I', "Indexed_directory" },
+ { EXT2_NOTAIL_FL, 't', "No_Tailmerging" },
+ { EXT2_TOPDIR_FL, 'T', "Top_of_Directory_Hierarchies" },
+ { 0, '\0', NULL }
};
void print_flags(FILE *f, unsigned long flags, unsigned options)
@@ -176,7 +176,7 @@ void print_flags(FILE *f, unsigned long flags, unsigned options)
if (options & PFOPT_LONG) {
int first = 1;
- for (fp = flags_array; fp->flag != 0; fp++) {
+ for (fp = flags_array; fp->short_name; fp++) {
if (flags & fp->flag) {
if (!first)
fputs(", ", f);
@@ -187,11 +187,11 @@ void print_flags(FILE *f, unsigned long flags, unsigned options)
if (first)
fputs("---", f);
} else {
- for (fp = flags_array; fp->flag != 0; fp++) {
- const char *p = "-";
+ for (fp = flags_array; fp->short_name; fp++) {
+ char c = '-';
if (flags & fp->flag)
- p = fp->short_name;
- fputs(p, f);
+ c = fp->short_name;
+ fputc(c, f);
}
}
}