mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-31 12:12:57 +03:00
Merge branch '2121_dir_symlink'
* 2121_dir_symlink: Applied MC indentation policy. compute_dir_size() function now respect 'follow symlinks' option Ticket #2121: don't calculate directory size if directory is symlink.
This commit is contained in:
commit
3c19b9f002
@ -1308,7 +1308,7 @@ single_dirsize_cmd (void)
|
||||
total = 0.0;
|
||||
|
||||
if (compute_dir_size (entry->fname, ui, compute_dir_size_update_ui,
|
||||
&marked, &total) == FILE_CONT)
|
||||
&marked, &total, TRUE) == FILE_CONT)
|
||||
{
|
||||
entry->st.st_size = (off_t) total;
|
||||
entry->f.dir_size_computed = 1;
|
||||
@ -1347,7 +1347,7 @@ dirsizes_cmd (void)
|
||||
total = 0.0l;
|
||||
|
||||
if (compute_dir_size (panel->dir.list[i].fname,
|
||||
ui, compute_dir_size_update_ui, &marked, &total) != FILE_CONT)
|
||||
ui, compute_dir_size_update_ui, &marked, &total, TRUE) != FILE_CONT)
|
||||
break;
|
||||
|
||||
panel->dir.list[i].st.st_size = (off_t) total;
|
||||
|
2694
src/file.c
2694
src/file.c
File diff suppressed because it is too large
Load Diff
39
src/file.h
39
src/file.h
@ -6,26 +6,25 @@
|
||||
#ifndef MC_FILE_H
|
||||
#define MC_FILE_H
|
||||
|
||||
#include <sys/types.h> /* off_t */
|
||||
#include <sys/types.h> /* off_t */
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
#include "dialog.h" /* Dlg_head */
|
||||
#include "widget.h" /* WLabel */
|
||||
#include "dialog.h" /* Dlg_head */
|
||||
#include "widget.h" /* WLabel */
|
||||
#include "fileopctx.h"
|
||||
|
||||
struct link;
|
||||
|
||||
FileProgressStatus copy_file_file (FileOpTotalContext *tctx, FileOpContext *ctx,
|
||||
const char *src_path, const char *dst_path);
|
||||
FileProgressStatus move_dir_dir (FileOpTotalContext *tctx, FileOpContext *ctx,
|
||||
const char *s, const char *d);
|
||||
FileProgressStatus copy_dir_dir (FileOpTotalContext *tctx, FileOpContext *ctx,
|
||||
const char *s, const char *d,
|
||||
gboolean toplevel, gboolean move_over, gboolean do_delete,
|
||||
struct link *parent_dirs);
|
||||
FileProgressStatus erase_dir (FileOpTotalContext *tctx, FileOpContext *ctx,
|
||||
const char *s);
|
||||
FileProgressStatus copy_file_file (FileOpTotalContext * tctx, FileOpContext * ctx,
|
||||
const char *src_path, const char *dst_path);
|
||||
FileProgressStatus move_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
|
||||
const char *s, const char *d);
|
||||
FileProgressStatus copy_dir_dir (FileOpTotalContext * tctx, FileOpContext * ctx,
|
||||
const char *s, const char *d,
|
||||
gboolean toplevel, gboolean move_over, gboolean do_delete,
|
||||
struct link *parent_dirs);
|
||||
FileProgressStatus erase_dir (FileOpTotalContext * tctx, FileOpContext * ctx, const char *s);
|
||||
|
||||
gboolean panel_operate (void *source_panel, FileOperation op, gboolean force_single);
|
||||
|
||||
@ -38,21 +37,23 @@ FileProgressStatus file_error (const char *format, const char *file);
|
||||
|
||||
/* Compute directory size */
|
||||
/* callback to update status dialog */
|
||||
typedef FileProgressStatus (*compute_dir_size_callback)(const void *ui, const char *dirname);
|
||||
typedef FileProgressStatus (*compute_dir_size_callback) (const void *ui, const char *dirname);
|
||||
|
||||
/* return value is FILE_CONT or FILE_ABORT */
|
||||
FileProgressStatus compute_dir_size (const char *dirname, const void *ui,
|
||||
compute_dir_size_callback cback,
|
||||
off_t *ret_marked, double *ret_total);
|
||||
compute_dir_size_callback cback,
|
||||
off_t * ret_marked, double *ret_total,
|
||||
gboolean compute_symlinks);
|
||||
|
||||
/* status dialog of directory size computing */
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
Dlg_head *dlg;
|
||||
WLabel *dirname;
|
||||
} ComputeDirSizeUI;
|
||||
|
||||
ComputeDirSizeUI *compute_dir_size_create_ui (void);
|
||||
void compute_dir_size_destroy_ui (ComputeDirSizeUI *ui);
|
||||
void compute_dir_size_destroy_ui (ComputeDirSizeUI * ui);
|
||||
FileProgressStatus compute_dir_size_update_ui (const void *ui, const char *dirname);
|
||||
|
||||
#endif /* MC_FILE_H */
|
||||
#endif /* MC_FILE_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user