diff options
author | Moshe Piekarski <dev.rockbox@melachim.net> | 2020-06-29 15:41:17 -0400 |
---|---|---|
committer | Franklin Wei <franklin@rockbox.org> | 2020-07-26 15:15:38 -0400 |
commit | 73b02a4a2c04dafafdaa3f4f1fb388c3b8e26f0d (patch) | |
tree | a76b757497e20a636a528928dbd7e58cdae3fdde /apps | |
parent | 18ffb9275c59fa0043e70a6e9717e632ca5a4996 (diff) |
Make md5sum more verbose
Solves FS#9539
Change-Id: I5278fa0fbb8347314ef6fb41e707b3832f1dd8cd
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/md5sum.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/apps/plugins/md5sum.c b/apps/plugins/md5sum.c index c993018852..f69c71a49f 100644 --- a/apps/plugins/md5sum.c +++ b/apps/plugins/md5sum.c @@ -183,9 +183,12 @@ static void hash_check( int out, const char *path ) enum plugin_status plugin_start(const void* parameter) { - const char *arg = (const char *)parameter; /* input file name, if any */ + const char *arg = (const char *)parameter; /* input file path, if any */ + char temp[MAX_PATH]; /* input file name */ + char *basename=temp; int out = -1; /* output file descriptor */ char filename[MAX_PATH]; /* output file name */ + int isdir=0; /*flag if input file is a directory */ void (*action)( int, const char * ) = NULL; @@ -240,10 +243,25 @@ enum plugin_status plugin_start(const void* parameter) action = hash_dir; arg = "/"; } + rb->strcpy(temp, arg); + if (temp[(rb->strlen(temp) - 1)] == '/') + { + temp[(rb->strlen(temp) - 1)] = '\0'; + isdir=1; + } + if(rb->strrchr(temp, '/')) + basename =(rb->strrchr(temp, '/')+1); + + if(isdir) + temp[(rb->strlen(temp))] = '/'; + + rb->lcd_putsf( 0, 1, "Hashing %s", basename ); + rb->lcd_puts( 0, 2, rb->str(LANG_ACTION_STD_CANCEL) ); - rb->lcd_puts( 0, 1, "Output file:" ); - rb->lcd_puts( 0, 2, filename ); + rb->lcd_puts( 0, 3, "Output file:" ); + rb->lcd_puts( 0, 4, filename ); + rb->lcd_update(); count = 0; done = 0; action( out, arg ); |