mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-08 20:41:59 +03:00
* dir.c (if_link_is_exe): Check mc_stat() return value.
Make full_name and file_entry const. (link_isdir): Make file_entry const. * dir.h: Adjust declarations.
This commit is contained in:
parent
52045633b3
commit
7b7d64ce1f
@ -1,3 +1,10 @@
|
|||||||
|
2003-10-24 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||||
|
|
||||||
|
* dir.c (if_link_is_exe): Check mc_stat() return value.
|
||||||
|
Make full_name and file_entry const.
|
||||||
|
(link_isdir): Make file_entry const.
|
||||||
|
* dir.h: Adjust declarations.
|
||||||
|
|
||||||
2003-10-24 Pavel Roskin <proski@gnu.org>
|
2003-10-24 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* view.c (view_handle_editkey): Fix prototype.
|
* view.c (view_handle_editkey): Fix prototype.
|
||||||
|
17
src/dir.c
17
src/dir.c
@ -477,7 +477,7 @@ do_load_dir (char *path, dir_list *list, sortfn *sort, int reverse,
|
|||||||
return set_zero_dir (list);
|
return set_zero_dir (list);
|
||||||
}
|
}
|
||||||
tree_store_start_check (path);
|
tree_store_start_check (path);
|
||||||
for (dp = mc_readdir (dirp); dp; dp = mc_readdir (dirp)) {
|
while ((dp = mc_readdir (dirp))) {
|
||||||
status =
|
status =
|
||||||
handle_dirent (list, filter, dp, &st, next_free, &link_to_dir,
|
handle_dirent (list, filter, dp, &st, next_free, &link_to_dir,
|
||||||
&stale_link);
|
&stale_link);
|
||||||
@ -506,9 +506,7 @@ do_load_dir (char *path, dir_list *list, sortfn *sort, int reverse,
|
|||||||
add_dotdot_to_list (list, next_free++);
|
add_dotdot_to_list (list, next_free++);
|
||||||
do_sort (list, sort, next_free - 1, reverse, case_sensitive);
|
do_sort (list, sort, next_free - 1, reverse, case_sensitive);
|
||||||
} else {
|
} else {
|
||||||
tree_store_end_check ();
|
next_free = set_zero_dir (list);
|
||||||
mc_closedir (dirp);
|
|
||||||
return set_zero_dir (list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mc_closedir (dirp);
|
mc_closedir (dirp);
|
||||||
@ -517,7 +515,7 @@ do_load_dir (char *path, dir_list *list, sortfn *sort, int reverse,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
link_isdir (file_entry *file)
|
link_isdir (const file_entry *file)
|
||||||
{
|
{
|
||||||
if (file->f.link_to_dir)
|
if (file->f.link_to_dir)
|
||||||
return 1;
|
return 1;
|
||||||
@ -526,12 +524,11 @@ link_isdir (file_entry *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
if_link_is_exe (char *full_name, file_entry *file)
|
if_link_is_exe (const char *full_name, const file_entry *file)
|
||||||
{
|
{
|
||||||
struct stat b;
|
struct stat b;
|
||||||
|
|
||||||
if (S_ISLNK (file->st.st_mode)) {
|
if (S_ISLNK (file->st.st_mode) && !mc_stat (full_name, &b)) {
|
||||||
mc_stat (full_name, &b);
|
|
||||||
return is_exe (b.st_mode);
|
return is_exe (b.st_mode);
|
||||||
} else
|
} else
|
||||||
return 1;
|
return 1;
|
||||||
@ -632,9 +629,7 @@ do_reload_dir (char *path, dir_list *list, sortfn *sort, int count,
|
|||||||
* we copied one.
|
* we copied one.
|
||||||
*/
|
*/
|
||||||
if (marked_cnt > 0) {
|
if (marked_cnt > 0) {
|
||||||
file_entry *p;
|
if ((g_hash_table_lookup (marked_files, dp->d_name))) {
|
||||||
if (NULL !=
|
|
||||||
(p = g_hash_table_lookup (marked_files, dp->d_name))) {
|
|
||||||
list->list[next_free].f.marked = 1;
|
list->list[next_free].f.marked = 1;
|
||||||
marked_cnt--;
|
marked_cnt--;
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,8 @@ typedef struct {
|
|||||||
|
|
||||||
extern sort_orders_t sort_orders [SORT_TYPES_TOTAL];
|
extern sort_orders_t sort_orders [SORT_TYPES_TOTAL];
|
||||||
|
|
||||||
int link_isdir (file_entry *);
|
int link_isdir (const file_entry *);
|
||||||
int if_link_is_exe (char *full_name, file_entry *file);
|
int if_link_is_exe (const char *full_name, const file_entry *file);
|
||||||
|
|
||||||
extern int show_backups;
|
extern int show_backups;
|
||||||
extern int show_dot_files;
|
extern int show_dot_files;
|
||||||
|
Loading…
Reference in New Issue
Block a user