Save SQL command (not isql's own commands) to a history file only if we are in interactive mode.
| 244 | // Save SQL command (not isql's own commands) to a history file only if we |
| 245 | // are in interactive mode. |
| 246 | void InputDevices::saveCommand(const char* statement, const char* term) |
| 247 | { |
| 248 | if (m_ifp.indev_fpointer == stdin) |
| 249 | { |
| 250 | FILE* f = m_ofp.indev_fpointer; |
| 251 | if (f) |
| 252 | { |
| 253 | fputs(statement, f); |
| 254 | fputs(term, f); |
| 255 | // Add newline to make the file more readable. |
| 256 | fputc('\n', f); |
| 257 | } |
| 258 | else |
| 259 | { |
| 260 | Command* command = FB_NEW Command(statement, term); |
| 261 | commands.add(command); |
| 262 | } |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | // Are we reading from stdin now or from a file? |
| 267 | bool InputDevices::readingStdin() const |