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

Proposed by Sam Spilsbury on 2011-09-14
Status: Merged
Approved by: Sam Spilsbury on 2011-09-15
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 2011-09-14 Approve on 2011-09-15
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.
Didier Roche (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
=== modified file 'src/main.c'
--- src/main.c 2011-08-20 19:03:37 +0000
+++ src/main.c 2011-09-14 14:38:23 +0000
@@ -1485,7 +1485,7 @@
1485 setting->value->value.asList = ccsCopyList (data, setting);1485 setting->value->value.asList = ccsCopyList (data, setting);
14861486
1487 if ((strcmp (setting->name, "active_plugins") == 0) &&1487 if ((strcmp (setting->name, "active_plugins") == 0) &&
1488 (strcmp (setting->parent->name, "core") == 0))1488 (strcmp (setting->parent->name, "core") == 0) && processChanged)
1489 {1489 {
1490 CCSStringList list;1490 CCSStringList list;
14911491
@@ -3141,7 +3141,7 @@
3141 }3141 }
3142 3142
3143 sl = upgrade->clearValueSettings;3143 sl = upgrade->clearValueSettings;
3144 3144
3145 while (sl)3145 while (sl)
3146 {3146 {
3147 CCSSetting *tempSetting = (CCSSetting *) sl->data;3147 CCSSetting *tempSetting = (CCSSetting *) sl->data;
@@ -3169,7 +3169,7 @@
3169 /* Try and remove any specified items from the list */3169 /* Try and remove any specified items from the list */
3170 CCSSettingValueList l = tempSetting->value->value.asList;3170 CCSSettingValueList l = tempSetting->value->value.asList;
3171 CCSSettingValueList nl = ccsCopyList (setting->value->value.asList, setting);3171 CCSSettingValueList nl = ccsCopyList (setting->value->value.asList, setting);
3172 3172
3173 while (l)3173 while (l)
3174 {3174 {
3175 CCSSettingValueList olv = nl;3175 CCSSettingValueList olv = nl;
@@ -3193,12 +3193,10 @@
31933193
3194 l = l->next;3194 l = l->next;
3195 }3195 }
3196 3196
3197 if (count)3197 D (D_FULL, "Removed %i items from %s\n", count, setting->name);
3198 {3198 ccsSetList (setting, nl, TRUE);
3199 D (D_FULL, "Removed %i items from %s\n", count, setting->name);3199
3200 ccsSetList (setting, nl, TRUE);
3201 }
3202 }3200 }
3203 }3201 }
32043202
@@ -3249,12 +3247,9 @@
32493247
3250 l = l->next;3248 l = l->next;
3251 }3249 }
3252 3250
3253 if (count)3251 D (D_FULL, "Appending %i items to %s\n", count, setting->name);
3254 {3252 ccsSetList (setting, nl, TRUE);
3255 D (D_FULL, "Appending %i items to %s\n", count, setting->name);
3256 ccsSetList (setting, nl, TRUE);
3257 }
3258 }3253 }
3259 }3254 }
3260 else3255 else
@@ -3384,7 +3379,7 @@
3384 char *uname, *tok;3379 char *uname, *tok;
3385 unsigned int fnlen = strlen (path) + strlen (name) + 1;3380 unsigned int fnlen = strlen (path) + strlen (name) + 1;
33863381
3387 upgrade->file = calloc (fnlen, sizeof (char));3382 upgrade->file = calloc (fnlen + 1, sizeof (char));
3388 sprintf (upgrade->file, "%s/%s", path, name);3383 sprintf (upgrade->file, "%s/%s", path, name);
33893384
3390 uname = tok = strdup (name);3385 uname = tok = strdup (name);
@@ -3464,12 +3459,14 @@
3464 cuSize = ftell (completedUpgrades);3459 cuSize = ftell (completedUpgrades);
3465 rewind (completedUpgrades);3460 rewind (completedUpgrades);
34663461
3467 cuBuffer = calloc (cuSize, sizeof (char));3462 cuBuffer = calloc (cuSize + 1, sizeof (char));
3468 cuReadSize = fread (cuBuffer, 1, cuSize, completedUpgrades);3463 cuReadSize = fread (cuBuffer, 1, cuSize, completedUpgrades);
34693464
3470 if (cuReadSize != cuSize)3465 if (cuReadSize != cuSize)
3471 D (D_FULL, "[WARNING] Couldn't read completed upgrades file!\n");3466 D (D_FULL, "[WARNING] Couldn't read completed upgrades file!\n");
34723467
3468 cuBuffer[cuSize] = '\0';
3469
3473 for (i = 0; i < nFile; i++)3470 for (i = 0; i < nFile; i++)
3474 {3471 {
3475 char *matched = strstr (cuBuffer, nameList[i]->d_name);3472 char *matched = strstr (cuBuffer, nameList[i]->d_name);

Subscribers

People subscribed via source and target branches

to all changes: