diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-11-29 17:40:18 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-11-29 17:40:18 +0000 |
commit | ac78a77fc15ca5601628215cf79cb3833928bb80 (patch) | |
tree | 2387cf5601ff633c8ce017d3971c5ad8bb6fb18a | |
parent | 887b2e6937e815db5231f7034b62000521077840 (diff) |
The last item in an enum should not have a trailing comma
-rw-r--r-- | usr.bin/sudo/def_data.h | 2 | ||||
-rw-r--r-- | usr.bin/sudo/mkdefaults | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/sudo/def_data.h b/usr.bin/sudo/def_data.h index 40cdb8fc76e..5887d527289 100644 --- a/usr.bin/sudo/def_data.h +++ b/usr.bin/sudo/def_data.h @@ -120,5 +120,5 @@ enum def_tupple { once, always, any, - all, + all }; diff --git a/usr.bin/sudo/mkdefaults b/usr.bin/sudo/mkdefaults index 856890050c9..f125e045258 100644 --- a/usr.bin/sudo/mkdefaults +++ b/usr.bin/sudo/mkdefaults @@ -109,8 +109,9 @@ print CFILE "\tNULL, 0, NULL\n }\n};\n"; # Print out def_tuple if (@tuple_values) { print HEADER "\nenum def_tupple {\n"; - foreach (@tuple_values) { - print HEADER "\t$_,\n"; + for ($i = 0; $i <= $#tuple_values; $i++) { + printf HEADER "\t%s%s\n", $tuple_values[$i], + $i != $#tuple_values ? "," : ""; } print HEADER "};\n"; } |