Hello community,

here is the log from the commit of package rofi-calc for openSUSE:Factory 
checked in at 2019-04-30 13:00:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rofi-calc (Old)
 and      /work/SRC/openSUSE:Factory/.rofi-calc.new.5536 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rofi-calc"

Tue Apr 30 13:00:10 2019 rev:6 rq:697393 version:1.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/rofi-calc/rofi-calc.changes      2019-04-23 
14:37:06.493514978 +0200
+++ /work/SRC/openSUSE:Factory/.rofi-calc.new.5536/rofi-calc.changes    
2019-04-30 13:00:16.290174142 +0200
@@ -1,0 +2,6 @@
+Wed Apr 24 08:53:23 UTC 2019 - mvet...@suse.com
+
+- Update to 1.5:
+  * Fix invalid free in case rofi dir didn't already exist
+
+-------------------------------------------------------------------

Old:
----
  v1.4.tar.gz

New:
----
  v1.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rofi-calc.spec ++++++
--- /var/tmp/diff_new_pack.aOXEFu/_old  2019-04-30 13:00:18.358173680 +0200
+++ /var/tmp/diff_new_pack.aOXEFu/_new  2019-04-30 13:00:18.362173680 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           rofi-calc
-Version:        1.4
+Version:        1.5
 Release:        0
 Summary:        Calculator for rofi
 License:        MIT

++++++ v1.4.tar.gz -> v1.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rofi-calc-1.4/README.md new/rofi-calc-1.5/README.md
--- old/rofi-calc-1.4/README.md 2019-04-23 00:30:54.000000000 +0200
+++ new/rofi-calc-1.5/README.md 2019-04-23 18:57:25.000000000 +0200
@@ -18,6 +18,8 @@
 
 The result of the current input can be selected with `Ctrl+Enter`, and history 
entries can be selected with `Enter`. By default this will just output the 
equation/result.
 
+## Advanced Usage
+
 Use the `-terse` option to reduce the output of `qalc` to just the result of 
the input expression.
 
 Use the `-calc-command` option to specify a shell command to execute which 
will be interpolated with the following keys:
@@ -37,7 +39,7 @@
 
     rofi -show calc -modi calc -no-show-match -no-sort -no-bold
 
-To disable the history:
+To disable the history, use `-no-history`:
 
     rofi -show calc -modi calc -no-show-match -no-sort -no-history
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rofi-calc-1.4/src/calc.c new/rofi-calc-1.5/src/calc.c
--- old/rofi-calc-1.4/src/calc.c        2019-04-23 00:30:54.000000000 +0200
+++ new/rofi-calc-1.5/src/calc.c        2019-04-23 18:57:25.000000000 +0200
@@ -105,11 +105,16 @@
 // Append `input` to history.
 static void append_str_to_history(gchar* input) {
     GError *error = NULL;
-    gchar* history_file = g_build_filename(g_get_user_data_dir(), "rofi", 
"rofi_calc_history", NULL);
+    gchar* history_dir = g_build_filename(g_get_user_data_dir(), "rofi", NULL);
+    gchar* history_file = g_build_filename(history_dir, "rofi_calc_history", 
NULL);
     gchar* history_contents;
+    gboolean old_history_was_read = FALSE;
+
+    g_mkdir_with_parents(history_dir, 0755);
 
     if (g_file_test(history_file, G_FILE_TEST_EXISTS | 
G_FILE_TEST_IS_REGULAR)) {
         g_file_get_contents(history_file, &history_contents, NULL, &error);
+        old_history_was_read = TRUE;
 
         if (error != NULL) {
             g_error("Error while reading the history file: %s", 
error->message);
@@ -134,8 +139,11 @@
 
     g_free(limited_str);
     g_free(new_history);
-    g_free(history_contents);
+    if (old_history_was_read) {
+        g_free(history_contents);
+    }
     g_free(history_file);
+    g_free(history_dir);
 }
 
 


Reply via email to