forked from fepitre/qubes-xscreensaver
-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
xscreensaver-6.00-0001-screensaver_id-search-parenthesis-first-for-searchin.patch
48 lines (45 loc) · 1.6 KB
/
xscreensaver-6.00-0001-screensaver_id-search-parenthesis-first-for-searchin.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From ef72c9500015a36bf0b4b412337ec2d890d092b6 Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <[email protected]>
Date: Fri, 2 Apr 2021 18:46:14 +0900
Subject: [PATCH] screensaver_id: search parenthesis first for searching year
Fedora package modifies screensaver_id string to %%version-%%release .
Adjust window_init function so that "year" information is
parsed correctly.
---
driver/dialog.c | 4 +++-
driver/xscreensaver-systemd.c | 4 +++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/driver/dialog.c b/driver/dialog.c
index fce74c4..9a8173f 100644
--- a/driver/dialog.c
+++ b/driver/dialog.c
@@ -949,8 +949,10 @@ window_init (Widget root_widget, Bool splash_p)
/* Put the version number in the label. */
{
char *version = strdup (screensaver_id + 17);
- char *year = strchr (version, '-');
+ char *year;
char *s = strchr (version, ' ');
+ year = strchr (version, '('); /* Search parenthesis first */
+ year = strchr (year, '-');
*s = 0;
year = strchr (year+1, '-') + 1;
s = strchr (year, ')');
diff --git a/driver/xscreensaver-systemd.c b/driver/xscreensaver-systemd.c
index d06174a..c9a66a1 100644
--- a/driver/xscreensaver-systemd.c
+++ b/driver/xscreensaver-systemd.c
@@ -950,8 +950,10 @@ main (int argc, char **argv)
{
int i;
char *version = strdup (screensaver_id + 17);
- char *year = strchr (version, '-');
+ char *year;
char *s = strchr (version, ' ');
+ year = strchr (version, '('); /* Search parenthesis first */
+ year = strchr (year, '-');
*s = 0;
year = strchr (year+1, '-') + 1;
s = strchr (year, ')');
--
2.31.1