Loading commands/filesystem/find.cpp +14 −12 Changes for commands/filesystem/find.cpp: 14 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -631,24 +631,26 @@ namespace fresh { namespace cmd { for(; i<argc; ++i) { std::string a = argv[i]; // Accept escaped GNU find parentheses. if(a == "\\(") a = "("; else if(a == "\\)") a = ")"; // Some shell/build-script combinations can pass the // opening parenthesis attached to the first predicate: // "(-name" -> "(" + "-name" // GNU find escaped parentheses if(a == "\\(") { p.toks.push_back("("); continue; } if(a == "\\)") { p.toks.push_back(")"); continue; } // Be tolerant of attached parentheses, e.g. "(-name" if(a.size() > 2 && a.rfind("(-", 0) == 0) { p.toks.push_back("("); p.toks.push_back(a.substr(1)); continue; } // Same for a closing parenthesis attached to a predicate. if(a.size() > 2 && a.back() == ')' && a != ")") { // Be tolerant of "-type f)" etc. if(a.size() > 1 && a.back() == ')' && a != ")") { p.toks.push_back(a.substr(0, a.size() - 1)); p.toks.push_back(")"); continue; Loading Loading
commands/filesystem/find.cpp +14 −12 Changes for commands/filesystem/find.cpp: 14 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -631,24 +631,26 @@ namespace fresh { namespace cmd { for(; i<argc; ++i) { std::string a = argv[i]; // Accept escaped GNU find parentheses. if(a == "\\(") a = "("; else if(a == "\\)") a = ")"; // Some shell/build-script combinations can pass the // opening parenthesis attached to the first predicate: // "(-name" -> "(" + "-name" // GNU find escaped parentheses if(a == "\\(") { p.toks.push_back("("); continue; } if(a == "\\)") { p.toks.push_back(")"); continue; } // Be tolerant of attached parentheses, e.g. "(-name" if(a.size() > 2 && a.rfind("(-", 0) == 0) { p.toks.push_back("("); p.toks.push_back(a.substr(1)); continue; } // Same for a closing parenthesis attached to a predicate. if(a.size() > 2 && a.back() == ')' && a != ")") { // Be tolerant of "-type f)" etc. if(a.size() > 1 && a.back() == ')' && a != ")") { p.toks.push_back(a.substr(0, a.size() - 1)); p.toks.push_back(")"); continue; Loading