Changeset 10331


Ignore:
Timestamp:
Apr 9, 2011, 2:05:49 PM (9 years ago)
Author:
tbretz
Message:
Added Stop member function to interrupt readline.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Readline.cc

    r10308 r10331  
    10411041{
    10421042    char *buf = readline(prompt.c_str());
     1043
    10431044    Shutdown(buf ? buf : "");
    10441045
    1045     const string str = buf ? TrimSpaces(buf) : ".q";
     1046    const string str = !buf || (rl_done && rl_pending_input) ? ".q" : TrimSpaces(buf);
    10461047
    10471048    free(buf);
     
    10951096    }
    10961097}
     1098
     1099void Readline::Stop()
     1100{
     1101    rl_done          = 1;
     1102    rl_pending_input = 1;
     1103}
  • trunk/FACT++/src/Readline.h

    r10308 r10331  
    8787    virtual std::string Prompt(const std::string &prompt);
    8888    virtual void Run(const char *prompt=0);
     89    static  void Stop();
    8990
    9091    int GetLine() const { return fLine; }
Note: See TracChangeset for help on using the changeset viewer.