summaryrefslogtreecommitdiffstats
path: root/common/env_common.c
diff options
context:
space:
mode:
authorAlexander Holler <holler@ahsoftware.de>2014-07-14 17:49:55 +0200
committerTom Rini <trini@ti.com>2014-07-22 07:44:26 -0400
commitecd1446fe1df00d7f7b9de286dba309d93b51870 (patch)
tree4379b5361d1ac07d36b56a6fadf4cae1cb6b3d64 /common/env_common.c
parent8973601c38c63726e344fd1eb416f05ae18aec91 (diff)
downloadtalos-obmc-uboot-ecd1446fe1df00d7f7b9de286dba309d93b51870.tar.gz
talos-obmc-uboot-ecd1446fe1df00d7f7b9de286dba309d93b51870.zip
Add option -r to env import to allow import of text files with CRLF as line endings
When this option is enabled, CRLF is treated like LF when importing environments from text files, which means CRs ('\r') in front of LFs ('\n') are just ignored. Drawback of enabling this option is that (maybe exported) variables which have a trailing CR in their content will get imported without that CR. But this drawback is very unlikely and the big advantage of letting Windows user create a *working* uEnv.txt too is likely more welcome. Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Diffstat (limited to 'common/env_common.c')
-rw-r--r--common/env_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/env_common.c b/common/env_common.c
index 3b979bcb98..af59c72e1f 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -118,7 +118,7 @@ void set_default_env(const char *s)
}
if (himport_r(&env_htab, (char *)default_environment,
- sizeof(default_environment), '\0', flags,
+ sizeof(default_environment), '\0', flags, 0,
0, NULL) == 0)
error("Environment import failed: errno = %d\n", errno);
@@ -135,7 +135,7 @@ int set_default_vars(int nvars, char * const vars[])
*/
return himport_r(&env_htab, (const char *)default_environment,
sizeof(default_environment), '\0',
- H_NOCLEAR | H_INTERACTIVE, nvars, vars);
+ H_NOCLEAR | H_INTERACTIVE, 0, nvars, vars);
}
#ifdef CONFIG_ENV_AES
@@ -212,7 +212,7 @@ int env_import(const char *buf, int check)
return ret;
}
- if (himport_r(&env_htab, (char *)ep->data, ENV_SIZE, '\0', 0,
+ if (himport_r(&env_htab, (char *)ep->data, ENV_SIZE, '\0', 0, 0,
0, NULL)) {
gd->flags |= GD_FLG_ENV_READY;
return 1;
OpenPOWER on IntegriCloud