aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--applets/applet_tables.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/applets/applet_tables.c b/applets/applet_tables.c
index e3d10c83f..ce2037440 100644
--- a/applets/applet_tables.c
+++ b/applets/applet_tables.c
@@ -84,7 +84,15 @@ int main(int argc, char **argv)
84 84
85 qsort(applets, NUM_APPLETS, sizeof(applets[0]), cmp_name); 85 qsort(applets, NUM_APPLETS, sizeof(applets[0]), cmp_name);
86 86
87 if (!argv[1]) 87 for (i = j = 0; i < NUM_APPLETS-1; ++i) {
88 if (cmp_name(applets+i, applets+i+1) == 0) {
89 fprintf(stderr, "%s: duplicate applet name '%s'\n", argv[0],
90 applets[i].name);
91 j = 1;
92 }
93 }
94
95 if (j != 0 || !argv[1])
88 return 1; 96 return 1;
89 snprintf(tmp1, PATH_MAX, "%s.%u.new", argv[1], (int) getpid()); 97 snprintf(tmp1, PATH_MAX, "%s.%u.new", argv[1], (int) getpid());
90 i = open(tmp1, O_WRONLY | O_TRUNC | O_CREAT, 0666); 98 i = open(tmp1, O_WRONLY | O_TRUNC | O_CREAT, 0666);