diff options
-rw-r--r-- | apps/tree.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/tree.c b/apps/tree.c index 58457c2d71..f40e6eaa2a 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -276,9 +276,11 @@ static int tree_voice_cb(int selected_item, void * data) | |||
276 | 276 | ||
277 | /* spell name AFTER voicing filetype */ | 277 | /* spell name AFTER voicing filetype */ |
278 | if (spell_name) { | 278 | if (spell_name) { |
279 | bool stripit = false; | ||
280 | char *ext = NULL; | ||
281 | |||
279 | /* Don't spell the extension if it's not displayed */ | 282 | /* Don't spell the extension if it's not displayed */ |
280 | if (!is_dir) { | 283 | if (!is_dir) { |
281 | bool stripit; | ||
282 | switch(global_settings.show_filename_ext) { | 284 | switch(global_settings.show_filename_ext) { |
283 | case 0: | 285 | case 0: |
284 | /* show file extension: off */ | 286 | /* show file extension: off */ |
@@ -301,13 +303,15 @@ static int tree_voice_cb(int selected_item, void * data) | |||
301 | } | 303 | } |
302 | 304 | ||
303 | if (stripit) { | 305 | if (stripit) { |
304 | char *ext = strrchr(name, '.'); | 306 | ext = strrchr(name, '.'); |
305 | if (ext) | 307 | if (ext) |
306 | *ext = 0; | 308 | *ext = 0; |
307 | } | 309 | } |
308 | } | 310 | } |
309 | |||
310 | talk_spell(name, true); | 311 | talk_spell(name, true); |
312 | |||
313 | if (stripit && ext) | ||
314 | *ext = '.'; | ||
311 | } | 315 | } |
312 | 316 | ||
313 | return 0; | 317 | return 0; |