mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
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>
This commit is contained in:
parent
8973601c38
commit
ecd1446fe1
4 changed files with 36 additions and 9 deletions
|
@ -102,7 +102,8 @@ extern ssize_t hexport_r(struct hsearch_data *__htab,
|
|||
*/
|
||||
extern int himport_r(struct hsearch_data *__htab,
|
||||
const char *__env, size_t __size, const char __sep,
|
||||
int __flag, int nvars, char * const vars[]);
|
||||
int __flag, int __crlf_is_lf, int nvars,
|
||||
char * const vars[]);
|
||||
|
||||
/* Walk the whole table calling the callback on each element */
|
||||
extern int hwalk_r(struct hsearch_data *__htab, int (*callback)(ENTRY *));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue