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
e935fd4f
Commit
e935fd4f
authored
7 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: reshuffle a couple of lines to avoid a duplicate call
Trim a superfluous assert too.
parent
a43eee6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/files.c
+10
-15
src/files.c
with
10 additions
and
15 deletions
+10
-15
src/files.c
View file @
e935fd4f
...
...
@@ -62,32 +62,29 @@ bool has_valid_path(const char *filename)
return
validity
;
}
/* Add an
entry
to the circular list of openfile structs. */
/* Add an
item
to the circular list of openfile structs. */
void
make_new_buffer
(
void
)
{
if
(
openfile
==
NULL
)
{
openfile
=
make_new_opennode
();
openfilestruct
*
newnode
=
make_new_opennode
();
if
(
openfile
==
NULL
)
{
/* Make the first open file the only element in the list. */
openfil
e
->
prev
=
openfil
e
;
openfil
e
->
next
=
openfil
e
;
newnod
e
->
prev
=
newnod
e
;
newnod
e
->
next
=
newnod
e
;
}
else
{
openfilestruct
*
newnode
=
make_new_opennode
();
/* Add the new open file after the current one in the list. */
newnode
->
prev
=
openfile
;
newnode
->
next
=
openfile
->
next
;
openfile
->
next
->
prev
=
newnode
;
openfile
->
next
=
newnode
;
/* Make the new file the current one. */
openfile
=
newnode
;
/* There is more than one file open: show Close in help lines. */
/* There is more than one file open: show "Close" in help lines. */
exitfunc
->
desc
=
close_tag
;
}
/* Start initializing the new buffer. */
/* Make the new buffer the current one, and start initializing it. */
openfile
=
newnode
;
openfile
->
filename
=
mallocstrcpy
(
NULL
,
""
);
initialize_buffer_text
();
...
...
@@ -117,11 +114,9 @@ void make_new_buffer(void)
#endif
}
/* Initialize the text of the current openfile struct. */
/* Initialize the text
and pointers
of the current openfile struct. */
void
initialize_buffer_text
(
void
)
{
assert
(
openfile
!=
NULL
);
openfile
->
fileage
=
make_new_node
(
NULL
);
openfile
->
fileage
->
data
=
mallocstrcpy
(
NULL
,
""
);
...
...
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