summaryrefslogtreecommitdiff
path: root/app/bin/problemrep.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/bin/problemrep.c')
-rw-r--r--app/bin/problemrep.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/app/bin/problemrep.c b/app/bin/problemrep.c
index 6e23984..c508be4 100644
--- a/app/bin/problemrep.c
+++ b/app/bin/problemrep.c
@@ -48,6 +48,7 @@
#include "include/paramfilelist.h"
#include "paths.h"
#include "version.h"
+#include "cundo.h"
static void SaveSystemInfo(char* dir);
static void ZipProblemData(const char* src);
@@ -489,7 +490,9 @@ PickupLayoutFile(char* dir)
char* lineptr = NULL;
size_t linelen = 0;
while (!feof(fhRead)) {
- getline(&lineptr, &linelen, fhRead);
+ if ( getline(&lineptr, &linelen, fhRead) == -1 ) {
+ break;
+ };
if (!feof(fhRead)) {
FilterLayoutLine(fhWrite, lineptr);
}
@@ -530,6 +533,31 @@ PickupCustomFile(char* dest)
}
/**
+ * Get the undo log file.
+ *
+ * \param dest temporary directory
+ * \return true on success
+ */
+
+static bool
+PickupUndoLog(char* dest)
+{
+ char* outFile;
+
+ MakeFullpath(&outFile, dest, "command.log", NULL);
+ FILE * fDump = fopen( outFile, "w" );
+ if ( fDump == NULL ) {
+ ProblemrepUpdateW(_("Get command log file FAILed: %s\n"), outFile);
+ free(outFile);
+ return false;
+ }
+ ProblemrepUpdateW(_("Get command log file %s\n"), outFile);
+ Rdump(fDump);
+ free(outFile);
+ return(true);
+}
+
+/**
* Create a zip file from the collected information. The zip file is created
* in the same directory as the layout design. A unique name is generated from
* the current date and time.
@@ -617,6 +645,8 @@ ProblemDataCollect()
free(subdirectory);
subdirectory = NULL;
+ PickupUndoLog(tempDirectory);
+
if (ret) {
ZipProblemData(tempDirectory);