Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
5c5fefc8
Commit
5c5fefc8
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
files: tweak the function tail() and rename two variables
parent
8aeb8434
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/files.c
+6
-9
src/files.c
src/proto.h
+1
-1
src/proto.h
with
7 additions
and
10 deletions
+7
-10
src/files.c
View file @
5c5fefc8
...
...
@@ -2927,18 +2927,15 @@ char *input_tab(char *buf, bool allow_files, size_t *place,
}
#endif
/* !DISABLE_TABCOMP */
/* Only print the last part of a path. Isn't there a shell command for
* this? */
const
char
*
tail
(
const
char
*
foo
)
/* Return the filename part of the given path. */
const
char
*
tail
(
const
char
*
path
)
{
const
char
*
tmp
=
strrchr
(
foo
,
'/'
);
const
char
*
slash
=
strrchr
(
path
,
'/'
);
if
(
tmp
==
NULL
)
tmp
=
foo
;
if
(
slash
==
NULL
)
return
path
;
else
tmp
++
;
return
tmp
;
return
++
slash
;
}
#ifndef DISABLE_HISTORIES
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
5c5fefc8
...
...
@@ -342,7 +342,7 @@ char **cwd_tab_completion(const char *buf, bool allow_files, size_t
char
*
input_tab
(
char
*
buf
,
bool
allow_files
,
size_t
*
place
,
bool
*
lastwastab
,
bool
*
listed
);
#endif
const
char
*
tail
(
const
char
*
foo
);
const
char
*
tail
(
const
char
*
path
);
#ifndef DISABLE_HISTORIES
char
*
histfilename
(
void
);
void
load_history
(
void
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help