El 16.04.2012 16:40, Brad Jorsch escribió:
On Sun, Apr 15, 2012 at 11:12:42PM +0200, Rodolfo García Peñas wrote:
The variable iconPath should only checked inside the if block,
because outside is never initialized.
Yes it is initialized, it is initialized to NULL.
Ok, the commit info is not accurate.
If is initialized to NULL, then this part of the code is never used if
we don't enter first in the "if (strstr(path, ".app"))" block.
if (iconPath) {
wApplicationSaveIconPathFor(iconPath, wm_instance,
wm_class);
wfree(iconPath);
}
185 void wApplicationExtractDirPackIcon(WScreen * scr, char *path, char
*wm_instance, char *wm_class)
186 {
187 char *iconPath = NULL;
188 char *tmp = NULL;
189
190 if (strstr(path, ".app")) {
191 tmp = wmalloc(strlen(path) + 16);
192
193 if (scr->flags.supports_tiff) {
194 strcpy(tmp, path);
195 strcat(tmp, ".tiff");
196 if (access(tmp, R_OK) == 0)
197 iconPath = tmp;
198 }
199
200 if (!iconPath) {
201 strcpy(tmp, path);
202 strcat(tmp, ".xpm");
203 if (access(tmp, R_OK) == 0)
204 iconPath = tmp;
205 }
206
207 if (!iconPath)
208 wfree(tmp);
209
210 if (iconPath) {
211 wApplicationSaveIconPathFor(iconPath,
wm_instance, wm_class);
212 wfree(iconPath);
213 }
214 }
215 }
--
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
--
To unsubscribe, send mail to [email protected].