Commit 942739cb authored by jan.koester's avatar jan.koester
Browse files

find renew

parent faaec04c
Loading
Loading
Loading
Loading
+15 −11
Changes for commands/filesystem/find.cpp: 15 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -613,6 +613,21 @@ namespace fresh { namespace cmd {
            s.now=time(nullptr);
            int i=1;
            // leading -H/-L/-P options
            for(; i<argc; ++i){
                std::string a=argv[i];
                if(a=="-L") s.followLinks=true;
                else if(a=="-H" || a=="-P") s.followLinks=false;
                else break;
            }
            std::vector<std::string> paths;
            for(; i<argc; ++i){
                std::string a=argv[i];
                if(a=="!" || a=="(" || (a.size()>1 && a[0]=='-')) break;
                paths.push_back(a);
            }
            if(paths.empty()) paths.push_back(".");

            Parser p(s);
            for(; i<argc; ++i) {
                std::string a = argv[i];

@@ -642,17 +657,6 @@ namespace fresh { namespace cmd {
                p.toks.push_back(a);
            }

            std::vector<std::string> paths;
            for(; i<argc; ++i){
                std::string a=argv[i];
                if(a=="!" || a=="(" || (a.size()>1 && a[0]=='-')) break;
                paths.push_back(a);
            }
            if(paths.empty()) paths.push_back(".");

            Parser p(s);
            for(; i<argc; ++i) p.toks.push_back(argv[i]);

            NodePtr expr;
            if(p.toks.empty()){
                expr=std::make_unique<Const>(true);