Merge lp:~compiz-team/compiz-libcompizconfig/compiz-libcompizconfig.fix_upgrades_errors into lp:compiz-libcompizconfig

Proposed by Sam Spilsbury
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 421
Merged at revision: 421
Proposed branch: lp:~compiz-team/compiz-libcompizconfig/compiz-libcompizconfig.fix_upgrades_errors
Merge into: lp:compiz-libcompizconfig
Diff against target: 88 lines (+14/-17)
1 file modified
src/main.c (+14/-17)
To merge this branch: bzr merge lp:~compiz-team/compiz-libcompizconfig/compiz-libcompizconfig.fix_upgrades_errors
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+75358@code.launchpad.net

Description of the change

Fixes the libcompizconfig tasks on LP # 838075

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

fixes the issue we discovered together :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/main.c'
2--- src/main.c 2011-08-20 19:03:37 +0000
3+++ src/main.c 2011-09-14 14:38:23 +0000
4@@ -1485,7 +1485,7 @@
5 setting->value->value.asList = ccsCopyList (data, setting);
6
7 if ((strcmp (setting->name, "active_plugins") == 0) &&
8- (strcmp (setting->parent->name, "core") == 0))
9+ (strcmp (setting->parent->name, "core") == 0) && processChanged)
10 {
11 CCSStringList list;
12
13@@ -3141,7 +3141,7 @@
14 }
15
16 sl = upgrade->clearValueSettings;
17-
18+
19 while (sl)
20 {
21 CCSSetting *tempSetting = (CCSSetting *) sl->data;
22@@ -3169,7 +3169,7 @@
23 /* Try and remove any specified items from the list */
24 CCSSettingValueList l = tempSetting->value->value.asList;
25 CCSSettingValueList nl = ccsCopyList (setting->value->value.asList, setting);
26-
27+
28 while (l)
29 {
30 CCSSettingValueList olv = nl;
31@@ -3193,12 +3193,10 @@
32
33 l = l->next;
34 }
35-
36- if (count)
37- {
38- D (D_FULL, "Removed %i items from %s\n", count, setting->name);
39- ccsSetList (setting, nl, TRUE);
40- }
41+
42+ D (D_FULL, "Removed %i items from %s\n", count, setting->name);
43+ ccsSetList (setting, nl, TRUE);
44+
45 }
46 }
47
48@@ -3249,12 +3247,9 @@
49
50 l = l->next;
51 }
52-
53- if (count)
54- {
55- D (D_FULL, "Appending %i items to %s\n", count, setting->name);
56- ccsSetList (setting, nl, TRUE);
57- }
58+
59+ D (D_FULL, "Appending %i items to %s\n", count, setting->name);
60+ ccsSetList (setting, nl, TRUE);
61 }
62 }
63 else
64@@ -3384,7 +3379,7 @@
65 char *uname, *tok;
66 unsigned int fnlen = strlen (path) + strlen (name) + 1;
67
68- upgrade->file = calloc (fnlen, sizeof (char));
69+ upgrade->file = calloc (fnlen + 1, sizeof (char));
70 sprintf (upgrade->file, "%s/%s", path, name);
71
72 uname = tok = strdup (name);
73@@ -3464,12 +3459,14 @@
74 cuSize = ftell (completedUpgrades);
75 rewind (completedUpgrades);
76
77- cuBuffer = calloc (cuSize, sizeof (char));
78+ cuBuffer = calloc (cuSize + 1, sizeof (char));
79 cuReadSize = fread (cuBuffer, 1, cuSize, completedUpgrades);
80
81 if (cuReadSize != cuSize)
82 D (D_FULL, "[WARNING] Couldn't read completed upgrades file!\n");
83
84+ cuBuffer[cuSize] = '\0';
85+
86 for (i = 0; i < nFile; i++)
87 {
88 char *matched = strstr (cuBuffer, nameList[i]->d_name);

Subscribers

People subscribed via source and target branches

to all changes: