File: vpattern.cc

package info (click to toggle)
filtermail 1.06.00-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,688 kB
  • sloc: cpp: 2,487; fortran: 249; makefile: 106; ansic: 51; sh: 36
file content (21 lines) | stat: -rw-r--r-- 476 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//#define XERR
#include "script.ih"

// overrides
void Script::vPattern(std::string const &script) 
{
    istringstream in{ script };

    string first;
    in >> first;            // there is content, so this succeeds

    d_mode =    first.find("SHELL") == 0 ? Proc::USE_SHELL : Proc::NO_PATH;

    if (d_mode == Proc::NO_PATH)
        d_command = script;
    else
        getline(in, d_command);

    d_command = String::trim(d_command);
    Options::setBase(d_command);
}