# HG changeset patch # User Olaf Wintermann # Date 1436455375 -7200 # Node ID 6a3248e22d586329605e115e46ec2f4b33602f17 # Parent 01cb9aabff05ec3093eda07256b26ceea7bb4b4d -a option wasn't working correctly in recursive mode diff -r 01cb9aabff05 -r 6a3248e22d58 dav/main.c --- a/dav/main.c Thu Jul 09 17:15:35 2015 +0200 +++ b/dav/main.c Thu Jul 09 17:22:55 2015 +0200 @@ -401,9 +401,7 @@ DavResource *child = ls->children; while(child) { - if(child->name[0] != '.' || show_all) { - print_func(child, a); - } + print_func(child, a); child = child->next; } @@ -509,6 +507,10 @@ void ls_print_list_elm(DavResource *res, CmdArgs *a) { int recursive = cmd_getoption(a, "recursive") ? 1 : 0; + int show_all = cmd_getoption(a, "all") ? 1 : 0; + if(res->name[0] == '.' && !show_all) { + return; + } char flags[16]; memset(flags, '-', 15); @@ -552,7 +554,10 @@ if(recursive) { DavResource *child = res->children; while(child) { - ls_print_list_elm(child, a); + //ls_print_list_elm(child, a); + if(child->name[0] != '.' || show_all) { + ls_print_list_elm(child, a); + } child = child->next; } } @@ -560,6 +565,11 @@ void ls_print_elm(DavResource *res, CmdArgs *a) { int recursive = cmd_getoption(a, "recursive") ? 1 : 0; + int show_all = cmd_getoption(a, "all") ? 1 : 0; + if(res->name[0] == '.' && !show_all) { + return; + } + char *name = recursive ? res->path+1 : res->name; printf("%s\n", name); if(recursive) {