From d0914542311cc7f8d14bb2113d802ae24a344eab Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 18 Jun 2025 19:37:12 +0000 Subject: driver: pe_cmd_from_program(): refactor (utilize the tool program name table). --- src/driver/pe_driver_ctx.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/driver') diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c index a806083..b99ee7f 100644 --- a/src/driver/pe_driver_ctx.c +++ b/src/driver/pe_driver_ctx.c @@ -175,6 +175,7 @@ static int pe_cmd_from_program(const char * program) const char * dot; const char * hyphen; const char * mark; + enum pe_cmd cmd; dot = strrchr(program,'.'); hyphen = strrchr(program,'-'); @@ -186,21 +187,12 @@ static int pe_cmd_from_program(const char * program) else mark = program; - if (!strcmp(mark,"perk")) { - return PERK_CMD_PERK; + for (cmd=0; cmd