diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/onplay.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index ded2994c97..5b22e72443 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -949,7 +949,9 @@ static int remove_dir(struct dirrecurse_params *parm) | |||
949 | /* share code for file and directory deletion, saves space */ | 949 | /* share code for file and directory deletion, saves space */ |
950 | static int delete_file_dir(void) | 950 | static int delete_file_dir(void) |
951 | { | 951 | { |
952 | if (confirm_delete(selected_file) != YESNO_YES) { | 952 | const char *to_delete=selected_file; |
953 | const int to_delete_attr=selected_file_attr; | ||
954 | if (confirm_delete(to_delete) != YESNO_YES) { | ||
953 | return 1; | 955 | return 1; |
954 | } | 956 | } |
955 | 957 | ||
@@ -958,9 +960,9 @@ static int delete_file_dir(void) | |||
958 | 960 | ||
959 | int rc = -1; | 961 | int rc = -1; |
960 | 962 | ||
961 | if (selected_file_attr & ATTR_DIRECTORY) { /* true if directory */ | 963 | if (to_delete_attr & ATTR_DIRECTORY) { /* true if directory */ |
962 | struct dirrecurse_params parm; | 964 | struct dirrecurse_params parm; |
963 | parm.append = strlcpy(parm.path, selected_file, sizeof (parm.path)); | 965 | parm.append = strlcpy(parm.path, to_delete, sizeof (parm.path)); |
964 | 966 | ||
965 | if (parm.append < sizeof (parm.path)) { | 967 | if (parm.append < sizeof (parm.path)) { |
966 | cpu_boost(true); | 968 | cpu_boost(true); |
@@ -968,7 +970,7 @@ static int delete_file_dir(void) | |||
968 | cpu_boost(false); | 970 | cpu_boost(false); |
969 | } | 971 | } |
970 | } else { | 972 | } else { |
971 | rc = remove(selected_file); | 973 | rc = remove(to_delete); |
972 | } | 974 | } |
973 | 975 | ||
974 | if (rc < OPRC_SUCCESS) { | 976 | if (rc < OPRC_SUCCESS) { |