summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-11-29 17:40:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-11-29 17:40:18 +0000
commitac78a77fc15ca5601628215cf79cb3833928bb80 (patch)
tree2387cf5601ff633c8ce017d3971c5ad8bb6fb18a
parent887b2e6937e815db5231f7034b62000521077840 (diff)
The last item in an enum should not have a trailing comma
-rw-r--r--usr.bin/sudo/def_data.h2
-rw-r--r--usr.bin/sudo/mkdefaults5
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";
}