summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-08-09 09:45:17 +0000
committerJim Meyering <jim@meyering.net>2006-08-09 09:45:17 +0000
commita5e7cc0811dcf543078c0f7f79fa159232a0ea6f (patch)
tree897f740a980ebdc9a7e7b05d3d987632043ca0f8 /src
parentff7f318ae13493351ec56e073a32df702cfc0356 (diff)
downloadcoreutils-a5e7cc0811dcf543078c0f7f79fa159232a0ea6f.tar.xz
Add a compile-time check to ensure that filetype
and filetype_letter have the same number of elements.
Diffstat (limited to 'src')
-rw-r--r--src/ls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index 85a4bc7e7..40de927bf 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -162,9 +162,12 @@ enum filetype
/* Display letters and indicators for each filetype.
Keep these in sync with enum filetype. */
-
static char const filetype_letter[] = "?pcdb-lswd";
+/* Ensure that filetype and filetype_letter have the same
+ number of elements. */
+verify (sizeof filetype_letter - 1 == arg_directory + 1);
+
#define FILETYPE_INDICATORS \
{ \
C_ORPHAN, C_FIFO, C_CHR, C_DIR, C_BLK, C_FILE, \