mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
env: Hide '.' variables in env print by default
When printing all variables with env print, don't print variables that begin with '.'. If env print is called with a '-a' switch, then include variables that begin with '.' (just like the ls command). Variables printed explicitly will be printed even without the -a. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
ec8a252cd4
commit
be11235ab8
13 changed files with 37 additions and 25 deletions
|
@ -522,7 +522,7 @@ static int cmpkey(const void *p1, const void *p2)
|
|||
return (strcmp(e1->key, e2->key));
|
||||
}
|
||||
|
||||
ssize_t hexport_r(struct hsearch_data *htab, const char sep,
|
||||
ssize_t hexport_r(struct hsearch_data *htab, const char sep, int flag,
|
||||
char **resp, size_t size,
|
||||
int argc, char * const argv[])
|
||||
{
|
||||
|
@ -559,6 +559,9 @@ ssize_t hexport_r(struct hsearch_data *htab, const char sep,
|
|||
if ((argc > 0) && (found == 0))
|
||||
continue;
|
||||
|
||||
if ((flag & H_HIDE_DOT) && ep->key[0] == '.')
|
||||
continue;
|
||||
|
||||
list[n++] = ep;
|
||||
|
||||
totlen += strlen(ep->key) + 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue