Diff of /trunk/src/gpx.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 297 by harbaum, Tue Aug 17 19:00:06 2010 UTC revision 298 by harbaum, Thu Aug 26 18:16:17 2010 UTC
# Line 1375  gpx_t *gpx_parse_dir(gpx_dialog_t *dialo Line 1375  gpx_t *gpx_parse_dir(gpx_dialog_t *dialo
1375          }          }
1376    
1377          free(filename);          free(filename);
1378    
1379          } else if(strcasecmp(ext, ".zip") == 0) {
1380            char *filename = malloc(strlen(dirname)+strlen(finfo->name)+2);
1381    
1382            strcpy(filename, dirname);
1383            if(strlastchr(filename) != '/')
1384              strcat(filename, "/");
1385            strcat(filename, finfo->name);
1386    
1387            gpx_t *new_gpx = decompress_zip(dialog, filename, username);
1388            if(new_gpx) {
1389              if(!gpx) gpx = new_gpx;
1390              else {
1391                /* append all caches from "new_gpx" to gpx */
1392    
1393                cache_t **cache = &(gpx->cache);
1394                while(*cache) cache = &(*cache)->next;
1395    
1396                *cache = new_gpx->cache;
1397                new_gpx->cache = NULL;
1398                gpx_free(new_gpx);
1399              }
1400            }
1401    
1402            free(filename);
1403        }        }
1404      }      }
1405    }    }

Legend:
Removed from v.297  
changed lines
  Added in v.298