Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
44774504
...
447745040b16d1dab3e36b0886546f90324ae60b
authored
2005-08-11 07:28:02 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mail_cd): Check chdir return value
1 parent
f19c3e15
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
mail/cd.c
mail/cd.c
View file @
4477450
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999 Free Software Foundation, Inc.
Copyright (C) 1999
, 2005
Free Software Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -26,11 +26,19 @@
int
mail_cd
(
int
argc
,
char
**
argv
)
{
char
*
dir
;
if
(
argc
>
2
)
return
1
;
else
if
(
argc
==
2
&&
(
chdir
(
argv
[
1
])
!=
0
))
return
1
;
else
if
(
argc
<
2
&&
chdir
(
getenv
(
"HOME"
))
!=
0
)
else
if
(
argc
==
2
)
dir
=
argv
[
1
];
else
dir
=
getenv
(
"HOME"
);
if
(
chdir
(
dir
))
{
mu_error
(
_
(
"cannot change to '%s': %s"
),
dir
,
mu_strerror
(
errno
));
return
1
;
}
return
0
;
}
...
...
Please
register
or
sign in
to post a comment