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
92d14adf
...
92d14adfcad0aab1359c964c5f123d73c9748f46
authored
2002-08-07 15:27:41 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Use util_setenv()
1 parent
0b7f9863
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
24 deletions
mail/set.c
mail/set.c
View file @
92d14ad
...
...
@@ -35,43 +35,33 @@ mail_set (int argc, char **argv)
else
{
int
i
=
0
;
char
*
value
=
NULL
;
struct
mail_env_entry
*
entry
=
NULL
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
if
(
!
strncmp
(
"no"
,
argv
[
i
],
2
))
{
entry
=
util_find_env
(
&
argv
[
i
][
2
]);
if
(
entry
==
NULL
)
return
1
;
entry
->
set
=
0
;
if
(
entry
->
value
)
free
(
entry
->
value
);
entry
->
value
=
NULL
;
util_setenv
(
&
argv
[
i
][
2
],
NULL
,
Mail_env_boolean
,
1
);
}
else
if
(
i
+
1
<
argc
&&
argv
[
i
+
1
][
0
]
==
'='
)
{
entry
=
util_find_env
(
argv
[
i
]);
if
(
entry
==
NULL
)
return
1
;
int
nval
;
char
*
name
=
argv
[
i
];
char
*
p
;
i
+=
2
;
if
(
i
>=
argc
)
break
;
value
=
strdup
(
argv
[
i
]);
entry
->
set
=
1
;
if
(
entry
->
value
)
free
(
entry
->
value
);
entry
->
value
=
value
;
nval
=
strtoul
(
argv
[
i
],
&
p
,
NULL
);
if
(
*
p
==
0
)
util_setenv
(
name
,
&
nval
,
Mail_env_number
,
1
);
else
util_setenv
(
name
,
argv
[
i
],
Mail_env_string
,
1
);
}
else
{
entry
=
util_find_env
(
argv
[
i
]);
if
(
entry
==
NULL
)
return
1
;
entry
->
set
=
1
;
if
(
entry
->
value
)
free
(
entry
->
value
);
entry
->
value
=
NULL
;
int
dummy
;
util_setenv
(
argv
[
i
],
&
dummy
,
Mail_env_boolean
,
1
);
}
}
return
0
;
...
...
Please
register
or
sign in
to post a comment