From b609b53fd35834323d74a4a63848a9ede3bf848c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 31 Mar 2015 01:17:00 +0200 Subject: [PATCH] mod_yparser: add find-exec function; return full path and filename of given executabe Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/68854aaed74ec69c0cde0ff4aea0bf9aacbf363e Author: vanhofen Date: 2015-03-31 (Tue, 31 Mar 2015) Origin message was: ------------------ - mod_yparser: add find-exec function; return full path and filename of given executabe ------------------ This commit was generated by Migit --- src/nhttpd/yhttpd_mods/mod_yparser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 35464dbe4..6d3670553 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -371,8 +371,9 @@ std::string CyParser::cgi_cmd_parsing(CyhookHandler *hh, // ini-set:;;[~open|save|cache] // if-empty:~~ // if-equal:~~~ (left_value == right_value?) -// if-not-equal:~~~ (left_val!e == right_value?) +// if-not-equal:~~~ (left_value == right_value?) // if-file-exists:~~ +// find-exec: // include-block:;[;] // var-get: // var-set:= @@ -427,6 +428,8 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) { yresult = (access(if_value, R_OK) == 0) ? if_then : if_else; } + } else if (ycmd_type == "find-exec") { + yresult = find_executable(ycmd_name.c_str()); } else if (ycmd_type == "include") { std::string ytmp; std::fstream fin(ycmd_name.c_str(), std::fstream::in);