9
0
Fork 0

saveenv: Fix saving to specified file

Since e805b7d saveenv: provide a zeroed/empty/ignore environment
barebox no longer honors the file argument when the directory
argument is also givin. Fix this.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-10-23 20:06:59 +02:00
parent 9ab02e4ec6
commit 15f8f9282e
1 changed files with 6 additions and 6 deletions

View File

@ -39,16 +39,16 @@ static int do_saveenv(int argc, char *argv[])
}
/* destination and source are given? */
if (argc == optind + 2)
dirname = argv[optind + 1];
else
if (argc - optind < 2)
dirname = "/env";
else
dirname = argv[optind + 1];
/* destination only given? */
if (argc == optind + 1)
filename = argv[optind];
else
if (argc - optind < 1)
filename = default_environment_path_get();
else
filename = argv[optind];
ret = envfs_save(filename, dirname, envfs_flags);