summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/checkwps/checkwps.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c
index 273db78646..3ee2908088 100644
--- a/tools/checkwps/checkwps.c
+++ b/tools/checkwps/checkwps.c
@@ -292,17 +292,30 @@ int main(int argc, char **argv)
292 /* Go through every skin that was thrown at us, error out at the first 292 /* Go through every skin that was thrown at us, error out at the first
293 * flawed wps */ 293 * flawed wps */
294 while (argv[filearg]) { 294 while (argv[filearg]) {
295 printf("Checking %s...\n", argv[filearg]); 295 const char* name = argv[filearg++];
296 char *ext = strrchr(name, '.');
297 printf("Checking %s...\n", name);
298 if (!ext)
299 {
300 printf("Invalid extension\n");
301 return 2;
302 }
303 ext++;
296#ifdef HAVE_REMOTE_LCD 304#ifdef HAVE_REMOTE_LCD
297 char *ext = strrchr(argv[filearg], '.'); 305 if (!strcmp(ext, "rwps") || !strcmp(ext, "rsbs") || !strcmp(ext, "rfms"))
298 if (strcmp(ext, "rwps") == 0 || strcmp(ext, "rsbs") == 0 || strcmp(ext, "rfms") == 0)
299 screen = SCREEN_REMOTE; 306 screen = SCREEN_REMOTE;
300 else 307 else
308#endif
309 if (!strcmp(ext, "wps") || !strcmp(ext, "sbs") || !strcmp(ext, "fms"))
301 screen = SCREEN_MAIN; 310 screen = SCREEN_MAIN;
302#endif 311 else
312 {
313 printf("Invalid extension\n");
314 return 2;
315 }
303 wps_screen = &screens[screen]; 316 wps_screen = &screens[screen];
304 317
305 res = skin_data_load(screen, &wps, argv[filearg], true); 318 res = skin_data_load(screen, &wps, name, true);
306 319
307 if (!res) { 320 if (!res) {
308 printf("WPS parsing failure\n"); 321 printf("WPS parsing failure\n");
@@ -313,7 +326,6 @@ int main(int argc, char **argv)
313 printf("WPS parsed OK\n\n"); 326 printf("WPS parsed OK\n\n");
314 if (wps_verbose_level>2) 327 if (wps_verbose_level>2)
315 skin_debug_tree(SKINOFFSETTOPTR(skin_buffer, wps.tree)); 328 skin_debug_tree(SKINOFFSETTOPTR(skin_buffer, wps.tree));
316 filearg++;
317 } 329 }
318 return 0; 330 return 0;
319} 331}