Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nccf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
702
Provoz
nccf
Commits
fd984e75
Commit
fd984e75
authored
15 years ago
by
Yorhel
Browse files
Options
Downloads
Patches
Plain Diff
Added hard link indicator in browser and help window
parent
757bdff7
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/browser.c
+1
-0
1 addition, 0 deletions
src/browser.c
src/calc.c
+3
-3
3 additions, 3 deletions
src/calc.c
src/global.h
+2
-1
2 additions, 1 deletion
src/global.h
src/help.c
+4
-2
4 additions, 2 deletions
src/help.c
with
10 additions
and
6 deletions
src/browser.c
+
1
−
0
View file @
fd984e75
...
...
@@ -176,6 +176,7 @@ void browse_draw_item(struct dir *n, int row, off_t max, int ispar) {
n
->
flags
&
FF_ERR
?
'!'
:
n
->
flags
&
FF_SERR
?
'.'
:
n
->
flags
&
FF_OTHFS
?
'>'
:
n
->
flags
&
FF_HLNK
?
'H'
:
!
(
n
->
flags
&
FF_FILE
||
n
->
flags
&
FF_DIR
)
?
'@'
:
n
->
flags
&
FF_DIR
...
...
This diff is collapsed.
Click to expand it.
src/calc.c
+
3
−
3
View file @
fd984e75
...
...
@@ -143,9 +143,9 @@ int calc_item(struct dir *par, char *name) {
for
(
i
=
0
;
i
<
linkst
;
i
++
)
if
(
links
[
i
].
dev
==
fs
.
st_dev
&&
links
[
i
].
ino
==
fs
.
st_ino
)
break
;
/* found in the list, set
size = 0
*/
/* found in the list, set
link flag (so the size won't get counted)
*/
if
(
i
!=
linkst
)
fs
.
st_block
s
=
fs
.
st_size
=
0
;
d
->
flag
s
|
=
FF_HLNK
;
/* not found, add to the list */
else
{
if
(
++
linkst
>
linksl
)
{
...
...
@@ -162,7 +162,7 @@ int calc_item(struct dir *par, char *name) {
}
/* count the size */
if
(
!
(
d
->
flags
&
FF_EXL
||
d
->
flags
&
FF_OTHFS
))
{
if
(
!
(
d
->
flags
&
FF_EXL
||
d
->
flags
&
FF_OTHFS
||
d
->
flags
&
FF_HLNK
))
{
d
->
size
=
fs
.
st_blocks
*
S_BLKSIZE
;
d
->
asize
=
fs
.
st_size
;
for
(
t
=
d
->
parent
;
t
!=
NULL
;
t
=
t
->
parent
)
{
...
...
This diff is collapsed.
Click to expand it.
src/global.h
+
2
−
1
View file @
fd984e75
...
...
@@ -37,7 +37,8 @@
#define FF_OTHFS 0x08
/* excluded because it was an other filesystem */
#define FF_EXL 0x10
/* excluded using exlude patterns */
#define FF_SERR 0x20
/* error in subdirectory */
#define FF_BSEL 0x40
/* selected */
#define FF_HLNK 0x40
/* hard link (same file already encountered before) */
#define FF_BSEL 0x80
/* selected */
/* Program states */
#define ST_CALC 0
...
...
This diff is collapsed.
Click to expand it.
src/help.c
+
4
−
2
View file @
fd984e75
...
...
@@ -95,14 +95,16 @@ void help_draw() {
ncaddch
(
7
,
4
,
'<'
);
ncaddch
(
8
,
4
,
'>'
);
ncaddch
(
9
,
4
,
'@'
);
ncaddch
(
10
,
4
,
'e'
);
ncaddch
(
10
,
4
,
'H'
);
ncaddch
(
11
,
4
,
'e'
);
attroff
(
A_BOLD
);
ncaddstr
(
5
,
7
,
"An error occured while reading this directory"
);
ncaddstr
(
6
,
7
,
"An error occured while reading a subdirectory"
);
ncaddstr
(
7
,
7
,
"File or directory is excluded from the statistics"
);
ncaddstr
(
8
,
7
,
"Directory was on an other filesystem"
);
ncaddstr
(
9
,
7
,
"This is not a file nor a dir (symlink, socket, ...)"
);
ncaddstr
(
10
,
7
,
"Empty directory"
);
ncaddstr
(
10
,
7
,
"Same file was already counted (hard link)"
);
ncaddstr
(
11
,
7
,
"Empty directory"
);
break
;
case
3
:
/* Indeed, too much spare time */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment