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
e198c850
Commit
e198c850
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename two variables, and elide a third
parent
05e2a6d2
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/search.c
+11
-14
src/search.c
with
11 additions
and
14 deletions
+11
-14
src/search.c
View file @
e198c850
...
...
@@ -1206,7 +1206,7 @@ filestruct *find_history(const filestruct *h_start, const filestruct
* list. */
void
update_history
(
filestruct
**
h
,
const
char
*
s
)
{
filestruct
**
hage
=
NULL
,
**
hbot
=
NULL
,
*
p
;
filestruct
**
hage
=
NULL
,
**
hbot
=
NULL
,
*
thesame
;
assert
(
h
!=
NULL
&&
s
!=
NULL
);
...
...
@@ -1220,22 +1220,19 @@ void update_history(filestruct **h, const char *s)
assert
(
hage
!=
NULL
&&
hbot
!=
NULL
);
/*
I
f this string is already in the history
, delete it
. */
p
=
find_history
(
*
hbot
,
*
hage
,
s
,
strlen
(
s
));
/*
See i
f this string is already in the history. */
thesame
=
find_history
(
*
hbot
,
*
hage
,
s
,
strlen
(
s
));
if
(
p
!=
NULL
)
{
filestruct
*
foo
,
*
bar
;
/* If an identical string was found, delete that item. */
if
(
thesame
!=
NULL
)
{
filestruct
*
after
=
thesame
->
next
;
/* If the string is at the beginning, move the beginning down to
* the next string. */
if
(
p
==
*
hage
)
*
hage
=
(
*
hage
)
->
next
;
/* If the string is at the head of the list, move the head. */
if
(
thesame
==
*
hage
)
*
hage
=
after
;
/* Delete the string. */
foo
=
p
;
bar
=
p
->
next
;
unlink_node
(
foo
);
renumber
(
bar
);
unlink_node
(
thesame
);
renumber
(
after
);
}
/* If the history is full, delete the beginning entry to make room
...
...
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