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
4c075f37
Commit
4c075f37
authored
9 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tabbing: rename four variables, snipping a redundant part
parent
0ccdaff9
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/files.c
+11
-12
src/files.c
with
11 additions
and
12 deletions
+11
-12
src/files.c
View file @
4c075f37
...
...
@@ -2833,31 +2833,30 @@ char *input_tab(char *buf, bool allow_files, size_t *place, bool
char
*
mzero
;
const
char
*
lastslash
=
revstrstr
(
buf
,
"/"
,
buf
+
*
place
);
size_t
lastslash_len
=
(
lastslash
==
NULL
)
?
0
:
lastslash
-
buf
+
1
;
char
*
match1
_mb
=
charalloc
(
mb_cur_max
());
char
*
match2
_mb
=
charalloc
(
mb_cur_max
());
int
match1_
mb_
len
,
match2_
mb_
len
;
char
*
match1
=
charalloc
(
mb_cur_max
());
char
*
match2
=
charalloc
(
mb_cur_max
());
int
match1_len
,
match2_len
;
/* Get the number of characters that all matches have in common. */
while
(
TRUE
)
{
match1_mb_len
=
parse_mbchar
(
matches
[
0
]
+
common_len
,
match1_mb
,
NULL
);
match1_len
=
parse_mbchar
(
matches
[
0
]
+
common_len
,
match1
,
NULL
);
for
(
match
=
1
;
match
<
num_matches
;
match
++
)
{
match2_
mb_
len
=
parse_mbchar
(
matches
[
match
]
+
common_len
,
match2
_mb
,
NULL
);
if
(
match1_
mb_
len
!=
match2_
mb_
len
||
strncmp
(
match1
_mb
,
match2
_mb
,
match2_
mb_
len
)
!=
0
)
match2_len
=
parse_mbchar
(
matches
[
match
]
+
common_len
,
match2
,
NULL
);
if
(
match1_len
!=
match2_len
||
strncmp
(
match1
,
match2
,
match2_len
)
!=
0
)
break
;
}
if
(
match
<
num_matches
||
matches
[
0
][
common_len
]
==
'\0'
)
break
;
common_len
+=
match1_
mb_
len
;
common_len
+=
match1_len
;
}
free
(
match1
_mb
);
free
(
match2
_mb
);
free
(
match1
);
free
(
match2
);
mzero
=
charalloc
(
lastslash_len
+
common_len
+
1
);
...
...
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