mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
Add a compile-time assertion that the slack_codes
and ls_codes arrays have the same number of elements. This would have prevented the above-fixed bug.
This commit is contained in:
1 parent
4005639856
commit
b648b4af3d
1 file changed
+2
-1
+2
-1
@@ -62,7 +62,6 @@ enum Shell_syntax
|
||||
variable. */
|
||||
static struct obstack lsc_obstack;
|
||||
|
||||
/* FIXME: associate with ls_codes? */
|
||||
static const char *const slack_codes[] =
|
||||
{
|
||||
"NORMAL", "NORM", "FILE", "DIR", "LNK", "LINK",
|
||||
@@ -78,6 +77,8 @@ static const char *const ls_codes[] =
|
||||
"so", "bd", "bd", "cd", "cd", "do", "ex", "lc", "lc", "rc", "rc", "ec", "ec"
|
||||
"su", "su", "sg", "sg", "st", "ow", "ow", "tw", "tw", NULL
|
||||
};
|
||||
#define array_cardinality(Array) (sizeof (Array) / sizeof *(Array))
|
||||
verify (array_cardinality (slack_codes) == array_cardinality (ls_codes));
|
||||
|
||||
static struct option const long_options[] =
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user