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
36e88032
Commit
36e88032
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename two variables, to make a little more sense
parent
e0a73f58
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/global.c
+4
-4
src/global.c
src/history.c
+7
-7
src/history.c
src/proto.h
+2
-2
src/proto.h
with
13 additions
and
13 deletions
+13
-13
src/global.c
View file @
36e88032
...
...
@@ -206,13 +206,13 @@ subnfunc *uncutfunc;
#ifndef DISABLE_HISTORIES
filestruct
*
search_history
=
NULL
;
/* The search string history list. */
filestruct
*
search
age
=
NULL
;
filestruct
*
search
top
=
NULL
;
/* The top of the search string history list. */
filestruct
*
searchbot
=
NULL
;
/* The bottom of the search string history list. */
filestruct
*
replace_history
=
NULL
;
/* The replace string history list. */
filestruct
*
replace
age
=
NULL
;
filestruct
*
replace
top
=
NULL
;
/* The top of the replace string history list. */
filestruct
*
replacebot
=
NULL
;
/* The bottom of the replace string history list. */
...
...
@@ -1832,8 +1832,8 @@ void thanks_for_all_the_fish(void)
#endif
/* !DISABLE_COLOR */
#ifndef DISABLE_HISTORIES
/* Free the search and replace history lists. */
free_filestruct
(
search
age
);
free_filestruct
(
replace
age
);
free_filestruct
(
search
top
);
free_filestruct
(
replace
top
);
#endif
/* Free the list of functions. */
while
(
allfuncs
!=
NULL
)
{
...
...
This diff is collapsed.
Click to expand it.
src/history.c
View file @
36e88032
...
...
@@ -33,12 +33,12 @@ void history_init(void)
{
search_history
=
make_new_node
(
NULL
);
search_history
->
data
=
mallocstrcpy
(
NULL
,
""
);
search
age
=
search_history
;
search
top
=
search_history
;
searchbot
=
search_history
;
replace_history
=
make_new_node
(
NULL
);
replace_history
->
data
=
mallocstrcpy
(
NULL
,
""
);
replace
age
=
replace_history
;
replace
top
=
replace_history
;
replacebot
=
replace_history
;
execute_history
=
make_new_node
(
NULL
);
...
...
@@ -81,10 +81,10 @@ void update_history(filestruct **h, const char *s)
filestruct
**
hage
=
NULL
,
**
hbot
=
NULL
,
*
thesame
;
if
(
*
h
==
search_history
)
{
hage
=
&
search
age
;
hage
=
&
search
top
;
hbot
=
&
searchbot
;
}
else
if
(
*
h
==
replace_history
)
{
hage
=
&
replace
age
;
hage
=
&
replace
top
;
hbot
=
&
replacebot
;
}
else
if
(
*
h
==
execute_history
)
{
hage
=
&
executetop
;
...
...
@@ -174,10 +174,10 @@ char *get_history_completion(filestruct **h, char *s, size_t len)
filestruct
*
hage
=
NULL
,
*
hbot
=
NULL
,
*
p
;
if
(
*
h
==
search_history
)
{
hage
=
search
age
;
hage
=
search
top
;
hbot
=
searchbot
;
}
else
if
(
*
h
==
replace_history
)
{
hage
=
replace
age
;
hage
=
replace
top
;
hbot
=
replacebot
;
}
else
if
(
*
h
==
execute_history
)
{
hage
=
executetop
;
...
...
@@ -405,7 +405,7 @@ void save_history(void)
/* Don't allow others to read or write the history file. */
chmod
(
searchhist
,
S_IRUSR
|
S_IWUSR
);
if
(
!
writehist
(
hist
,
search
age
)
||
!
writehist
(
hist
,
replace
age
)
||
if
(
!
writehist
(
hist
,
search
top
)
||
!
writehist
(
hist
,
replace
top
)
||
!
writehist
(
hist
,
executetop
))
fprintf
(
stderr
,
_
(
"Error writing %s: %s
\n
"
),
searchhist
,
strerror
(
errno
));
...
...
This diff is collapsed.
Click to expand it.
src/proto.h
View file @
36e88032
...
...
@@ -160,10 +160,10 @@ extern subnfunc *uncutfunc;
#ifndef DISABLE_HISTORIES
extern
filestruct
*
search_history
;
extern
filestruct
*
search
age
;
extern
filestruct
*
search
top
;
extern
filestruct
*
searchbot
;
extern
filestruct
*
replace_history
;
extern
filestruct
*
replace
age
;
extern
filestruct
*
replace
top
;
extern
filestruct
*
replacebot
;
extern
filestruct
*
execute_history
;
extern
filestruct
*
executetop
;
...
...
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