--- parser3/src/main/pa_exec.C 2002/01/25 12:36:38 1.20 +++ parser3/src/main/pa_exec.C 2002/01/25 12:59:43 1.22 @@ -4,7 +4,7 @@ Copyright(c) 2000,2001 ArtLebedev Group(http://www.artlebedev.com) Author: Alexander Petrosyan (http://paf.design.ru) - $Id: pa_exec.C,v 1.20 2002/01/25 12:36:38 paf Exp $ + $Id: pa_exec.C,v 1.22 2002/01/25 12:59:43 paf Exp $ @todo setrlimit @@ -383,13 +383,21 @@ from http://www.apache.org/websrc/cvsweb env->for_each(append_env_pair, &env_ref); *env_ref=0; } - if(int pid=execle_piped( + const char *pwd=getcwd(NULL, 0); + char dir[MAX_STRING]; + strncpy(dir, file_spec_cstr, MAX_STRING); + rsplit(dir,'/'); // trim filename + chdir(dir); + int pid=execle_piped( file_spec_cstr, argv_cstrs[0], argv_cstrs[1], argv_cstrs[2], argv_cstrs[3], argv_cstrs[4], argv_cstrs[5], argv_cstrs[6], argv_cstrs[7], argv_cstrs[8], argv_cstrs[9], env_cstrs, - &pipe_write, &pipe_read, &pipe_err)) { - + &pipe_write, &pipe_read, &pipe_err); + if (pwd) + chdir(pwd); + if(pid) { + // in child const char *in_cstr=in.cstr(); write(pipe_write, in_cstr, in.size()); close(pipe_write);