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
597d9020
Commit
597d9020
authored
6 years ago
by
Benno Schulenberg
Browse files
Options
Download
Email Patches
Plain Diff
startup: improve two error messages by mentioning the invalid operand
This addresses
https://savannah.gnu.org/bugs/?55304
.
parent
b1b23695
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/files.c
+10
-6
src/files.c
with
10 additions
and
6 deletions
+10
-6
src/files.c
View file @
597d9020
...
...
@@ -1465,12 +1465,14 @@ char *safe_tempfile(FILE **f)
/* Change to the specified operating directory, when it's valid. */
void
init_operating_dir
(
void
)
{
operating_dir
=
free_and_assign
(
operating_dir
,
get_full_path
(
operating_dir
)
)
;
char
*
target
=
get_full_path
(
operating_dir
);
/* If the operating directory is inaccessible, fail. */
if
(
operating_dir
==
NULL
||
chdir
(
operating_dir
)
==
-
1
)
die
(
_
(
"Invalid operating directory
\n
"
)
);
if
(
target
==
NULL
||
chdir
(
target
)
==
-
1
)
die
(
_
(
"Invalid operating directory
: %s
\n
"
),
operating_dir
);
free
(
operating_dir
);
operating_dir
=
target
;
snuggly_fit
(
&
operating_dir
);
}
...
...
@@ -1530,13 +1532,15 @@ int prompt_failed_backupwrite(const char *filename)
* and verify that it is usable. */
void
init_backup_dir
(
void
)
{
backup_dir
=
free_and_assign
(
backup_dir
,
get_full_path
(
backup_dir
)
)
;
char
*
target
=
get_full_path
(
backup_dir
);
/* If we can't get an absolute path (which means it doesn't exist or
* isn't accessible), or it's not a directory, fail. */
if
(
backup_dir
==
NULL
||
backup_dir
[
strlen
(
backup_dir
)
-
1
]
!=
'/'
)
die
(
_
(
"Invalid backup directory
\n
"
)
);
if
(
target
==
NULL
||
target
[
strlen
(
target
)
-
1
]
!=
'/'
)
die
(
_
(
"Invalid backup directory
: %s
\n
"
),
backup_dir
);
free
(
backup_dir
);
backup_dir
=
target
;
snuggly_fit
(
&
backup_dir
);
}
#endif
/* !NANO_TINY */
...
...
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