Skip to content

Commit 150198e

Browse files
Merge pull request #13 from NikolasK-source/main
v1.1.3
2 parents e54f4ed + d5fd92e commit 150198e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.13.4 FATAL_ERROR)
44
# ======================================================================================================================
55

66
# project
7-
project(stdin-to-modbus-shm LANGUAGES CXX VERSION 1.1.2)
7+
project(stdin-to-modbus-shm LANGUAGES CXX VERSION 1.1.3)
88

99
# settings
1010
set(Target "stdin-to-modbus-shm") # Executable name (without file extension!)

src/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,11 @@ int main(int argc, char **argv) {
422422
continue;
423423
}
424424

425+
if (!line.empty() && !VALID_HIST) add_history(line.c_str());
425426
} else {
426427
if (!std::getline(std::cin, line)) break;
427428
}
428429

429-
if (!line.empty() && !VALID_HIST) add_history(line.c_str());
430430

431431
// parse input
432432
std::vector<InputParser::Instruction> instructions;
@@ -437,7 +437,7 @@ int main(int argc, char **argv) {
437437
continue;
438438
}
439439

440-
if (VALID_HIST) add_history(line.c_str());
440+
if (INTERACTIVE && VALID_HIST) add_history(line.c_str());
441441

442442
// write value to target
443443
std::lock_guard<std::mutex> guard(m);
@@ -543,6 +543,8 @@ int main(int argc, char **argv) {
543543
}
544544
}
545545
}
546+
547+
rl_clear_history();
546548
terminate = true;
547549
};
548550

0 commit comments

Comments
 (0)