summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-private/private-history.cc3
-rwxr-xr-xtest/integration/test-history19
2 files changed, 21 insertions, 1 deletions
diff --git a/apt-private/private-history.cc b/apt-private/private-history.cc
index 834ff3411..5057ed0d6 100644
--- a/apt-private/private-history.cc
+++ b/apt-private/private-history.cc
@@ -103,7 +103,8 @@ static std::string GetKindString(const Entry &entry)
kindGroup += ",";
}
// remove trailing ","
- kindGroup.pop_back();
+ if (not kindGroup.empty())
+ kindGroup.pop_back();
return kindGroup;
}
diff --git a/test/integration/test-history b/test/integration/test-history
index 76bb3bd77..1b908de6d 100755
--- a/test/integration/test-history
+++ b/test/integration/test-history
@@ -68,3 +68,22 @@ testsuccessequal "ID Command line Date and Time Action C
0 dummy dummy Install 1
1 dummy dummy Install 1 " normalizedlist
+
+msgmsg "Actionless group"
+cat > rootdir/var/log/apt/history.log << EOF
+Start-Date: dummy
+Commandline: install nothing
+End-Date: dummy
+EOF
+
+testsuccessequal "ID Command line Date and Time Action Changes
+
+0 install nothing dummy 0 " normalizedlist
+
+testsuccessequal "Transaction ID: 0
+Start time: dummy
+End time: dummy
+Requested by:
+Command line: install nothing
+Packages changed:" normalizedinfo
+