From: Uwe Hermann Date: Sat, 15 Jan 2011 02:07:00 +0000 (+0100) Subject: Don't print .py suffix in protocol decoder names. X-Git-Tag: libsigrokdecode-0.1.0~314 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5b05904dc5dd1182fdf381b66fbc4a7ad97e37aa;p=libsigrokdecode.git Don't print .py suffix in protocol decoder names. --- diff --git a/decode.c b/decode.c index 598b2ba..3a1f63d 100644 --- a/decode.c +++ b/decode.c @@ -62,7 +62,8 @@ int sigrokdecode_init(void) while ((dp = readdir(dir)) != NULL) { if (!g_str_has_suffix(dp->d_name, ".py")) continue; - if ((tmp = strdup(dp->d_name))) + /* For now use the filename (without .py) as decoder name. */ + if ((tmp = g_strndup(dp->d_name, strlen(dp->d_name) - 3))) list_pds = g_slist_append(list_pds, tmp); } closedir(dir);