diff options
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 ) | |||
183 | 183 | ||
184 | enum plugin_status plugin_start(const void* parameter) | 184 | enum plugin_status plugin_start(const void* parameter) |
185 | { | 185 | { |
186 | const char *arg = (const char *)parameter; /* input file name, if any */ | 186 | const char *arg = (const char *)parameter; /* input file path, if any */ |
187 | char temp[MAX_PATH]; /* input file name */ | ||
188 | char *basename=temp; | ||
187 | int out = -1; /* output file descriptor */ | 189 | int out = -1; /* output file descriptor */ |
188 | char filename[MAX_PATH]; /* output file name */ | 190 | char filename[MAX_PATH]; /* output file name */ |
191 | int isdir=0; /*flag if input file is a directory */ | ||
189 | 192 | ||
190 | void (*action)( int, const char * ) = NULL; | 193 | void (*action)( int, const char * ) = NULL; |
191 | 194 | ||
@@ -240,10 +243,25 @@ enum plugin_status plugin_start(const void* parameter) | |||
240 | action = hash_dir; | 243 | action = hash_dir; |
241 | arg = "/"; | 244 | arg = "/"; |
242 | } | 245 | } |
246 | rb->strcpy(temp, arg); | ||
247 | if (temp[(rb->strlen(temp) - 1)] == '/') | ||
248 | { | ||
249 | temp[(rb->strlen(temp) - 1)] = '\0'; | ||
250 | isdir=1; | ||
251 | } | ||
252 | if(rb->strrchr(temp, '/')) | ||
253 | basename =(rb->strrchr(temp, '/')+1); | ||
254 | |||
255 | if(isdir) | ||
256 | temp[(rb->strlen(temp))] = '/'; | ||
257 | |||
258 | rb->lcd_putsf( 0, 1, "Hashing %s", basename ); | ||
259 | rb->lcd_puts( 0, 2, rb->str(LANG_ACTION_STD_CANCEL) ); | ||
243 | 260 | ||
244 | rb->lcd_puts( 0, 1, "Output file:" ); | 261 | rb->lcd_puts( 0, 3, "Output file:" ); |
245 | rb->lcd_puts( 0, 2, filename ); | 262 | rb->lcd_puts( 0, 4, filename ); |
246 | 263 | ||
264 | rb->lcd_update(); | ||
247 | count = 0; | 265 | count = 0; |
248 | done = 0; | 266 | done = 0; |
249 | action( out, arg ); | 267 | action( out, arg ); |