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
133ed4e2
Commit
133ed4e2
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tabbing: don't null-terminate a directory name on the slash but after it
This fixes
https://savannah.gnu.org/bugs/?47786
.
parent
53f4a9f5
master
feature/match-parens
refactor/readbility
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/files.c
+3
-2
src/files.c
with
3 additions
and
2 deletions
+3
-2
src/files.c
View file @
133ed4e2
...
...
@@ -2675,12 +2675,13 @@ char **cwd_tab_completion(const char *buf, bool allow_files, size_t
*
num_matches
=
0
;
null_at
(
&
dirname
,
buf_len
);
/* If there's a / in the name, s
trip
out
the
directory part. */
/* If there's a / in the name, s
plit
out
filename and
directory part
s
. */
slash
=
strrchr
(
dirname
,
'/'
);
if
(
slash
!=
NULL
)
{
char
*
wasdirname
=
dirname
;
filename
=
mallocstrcpy
(
NULL
,
slash
+
1
);
filename
=
mallocstrcpy
(
NULL
,
++
slash
);
/* Cut off the filename part after the slash. */
*
slash
=
'\0'
;
dirname
=
real_dir_from_tilde
(
dirname
);
free
(
wasdirname
);
...
...
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