quarks/x11-misc/tint2/files/battery_segfault.patch

21 lines
660 B
Diff

Index: battery.c
===================================================================
--- src/battery/battery.c (revision 575)
+++ src/battery/battery.c (revision 576)
@@ -194,8 +194,14 @@
}
g_free(path2);
}
+
+ path_current_now = g_build_filename(battery_dir, "power_now", NULL);
+ if (!g_file_test (path_current_now, G_FILE_TEST_EXISTS)) {
+ g_free(path_current_now);
+ path_current_now = g_build_filename(battery_dir, "current_now", NULL);
+ }
+
if (path_energy_now && path_energy_full) {
- path_current_now = g_build_filename(battery_dir, "current_now", NULL);
path_status = g_build_filename(battery_dir, "status", NULL);
// check file