Skip to content
GitLab
Menu
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
3129ff68
Commit
3129ff68
authored
8 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
tweaks: rename a variable, because nothing is returned there
parent
1d3d3077
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nano.c
+12
-11
src/nano.c
with
12 additions
and
11 deletions
+12
-11
src/nano.c
View file @
3129ff68
...
...
@@ -655,7 +655,7 @@ void die(const char *msg, ...)
exit
(
1
);
}
/* Save the current file under the name sp
a
cified in die_filename, which
/* Save the current file under the name sp
e
cified in die_filename, which
* is modified to be unique if necessary. */
void
die_save_file
(
const
char
*
die_filename
#ifndef NANO_TINY
...
...
@@ -663,7 +663,7 @@ void die_save_file(const char *die_filename
#endif
)
{
char
*
retval
;
char
*
targetname
;
bool
failed
=
TRUE
;
/* If we're using restricted mode, don't write any emergency backup
...
...
@@ -677,14 +677,15 @@ void die_save_file(const char *die_filename
if
(
*
die_filename
==
'\0'
)
die_filename
=
"nano"
;
retval
=
get_next_filename
(
die_filename
,
".save"
);
if
(
retval
[
0
]
!=
'\0'
)
failed
=
!
write_file
(
retval
,
NULL
,
TRUE
,
OVERWRITE
,
TRUE
);
targetname
=
get_next_filename
(
die_filename
,
".save"
);
if
(
*
targetname
!=
'\0'
)
failed
=
!
write_file
(
targetname
,
NULL
,
TRUE
,
OVERWRITE
,
TRUE
);
if
(
!
failed
)
fprintf
(
stderr
,
_
(
"
\n
Buffer written to %s
\n
"
),
retval
);
else
if
(
retval
[
0
]
!=
'\0'
)
fprintf
(
stderr
,
_
(
"
\n
Buffer not written to %s: %s
\n
"
),
retval
,
fprintf
(
stderr
,
_
(
"
\n
Buffer written to %s
\n
"
),
targetname
);
else
if
(
*
targetname
!=
'\0'
)
fprintf
(
stderr
,
_
(
"
\n
Buffer not written to %s: %s
\n
"
),
targetname
,
strerror
(
errno
));
else
fprintf
(
stderr
,
_
(
"
\n
Buffer not written: %s
\n
"
),
...
...
@@ -696,14 +697,14 @@ void die_save_file(const char *die_filename
* fast as possible. */
if
(
die_stat
)
{
int
shush
;
shush
=
chmod
(
retval
,
die_stat
->
st_mode
);
shush
=
chown
(
retval
,
die_stat
->
st_uid
,
die_stat
->
st_gid
);
shush
=
chmod
(
targetname
,
die_stat
->
st_mode
);
shush
=
chown
(
targetname
,
die_stat
->
st_uid
,
die_stat
->
st_gid
);
if
(
shush
)
;
}
#endif
free
(
retval
);
free
(
targetname
);
}
/* Initialize the three window portions nano uses. */
...
...
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