~ubuntu-branches/debian/sid/claws-mail/sid

« back to all changes in this revision

Viewing changes to src/plugins/rssyl/parse822.c

  • Committer: Package Import Robot
  • Author(s): Ricardo Mones
  • Date: 2015-08-18 16:37:25 UTC
  • mfrom: (1.3.7)
  • Revision ID: package-import@ubuntu.com-20150818163725-1it32n9mzqkwy2ef
Tags: 3.12.0-1
* New upstream release:
- 'cannot reorganize mailboxes' (Closes: #777208)
- 'dropdown menu bar has disappeared…'(Closes: #778886)
- 'depends on plugins libraries'  (Closes: #779824)
- 'new upstream version (3.12.0)…' (Closes: #793665)
* 14CVE_2010_5109.patch, 15fix_crash_open_folder.patch,
  13desktop_file_categories.patch
- Remove patches applied upstream
* debian/control, debian/copyright, debian/claws-mail-managesieve*
- Add managesieve plugin (new in this release)
* debian/rules
- Set perl-plugin manpage release version automatically
* 12fix_manpage_header.patch
- Update patch to cope with upstream changes
* debian/control, debian/watch
- Update VCS-* and watch URLs (thanks Julian Wollrath)

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
 
64
64
        g_file_get_contents(path, &contents, NULL, &error);
65
65
 
66
 
        if( error )
 
66
        if( error ) {
67
67
                g_warning("GError: '%s'\n", error->message);
 
68
                g_error_free(error);
 
69
        }
68
70
 
69
71
        if( contents != NULL ) {
70
72
                lines = strsplit_no_copy(contents, '\n');
241
243
static void rssyl_folder_read_existing_real(RFolderItem *ritem)
242
244
{
243
245
        gchar *path = NULL, *fname = NULL;
244
 
        DIR *dp;
245
 
        struct dirent *d;
246
 
        struct stat st;
 
246
        GDir *dp;
 
247
        const gchar *d;
 
248
        GError *error = NULL;
247
249
        gint num;
248
250
        FeedItem *item = NULL;
249
251
        RFeedCtx *ctx;
263
265
        ritem->items = NULL;
264
266
        ritem->last_update = 0;
265
267
 
266
 
        if( (dp = opendir(path)) == NULL ) {
267
 
                FILE_OP_ERROR(path, "opendir");
 
268
        if( (dp = g_dir_open(path, 0, &error)) == NULL ) {
 
269
                debug_print("g_dir_open on \"%s\" failed with error %d (%s)\n",
 
270
                                path, error->code, error->message);
 
271
                g_error_free(error);
268
272
                g_free(path);
269
273
                return;
270
274
        }
271
275
 
272
 
        while( (d = readdir(dp)) != NULL ) {
 
276
        while( (d = g_dir_read_name(dp)) != NULL ) {
273
277
                if( claws_is_exiting() ) {
274
 
                        closedir(dp);
 
278
                        g_dir_close(dp);
275
279
                        g_free(path);
276
280
                        return;
277
281
                }
278
282
 
279
 
                if( d->d_name[0] != '.' && (num = to_number(d->d_name)) > 0 ) {
280
 
                        fname = g_strdup_printf("%s%c%s", path, G_DIR_SEPARATOR, d->d_name);
281
 
                        if( g_stat(fname, &st) < 0 ) {
282
 
                                debug_print("RSSyl: couldn't stat() file '%s', ignoring it\n", fname);
283
 
                                g_free(fname);
284
 
                                continue;
285
 
                        }
286
 
 
287
 
                        if( !S_ISREG(st.st_mode)) {
 
283
                if( d[0] != '.' && (num = to_number(d)) > 0 ) {
 
284
                        fname = g_strdup_printf("%s%c%s", path, G_DIR_SEPARATOR, d);
 
285
                        if (!g_file_test(fname, G_FILE_TEST_IS_REGULAR)) {
288
286
                                debug_print("RSSyl: not a regular file: '%s', ignoring it\n", fname);
289
287
                                g_free(fname);
290
288
                                continue;
291
289
                        }
292
290
 
293
 
                        debug_print("RSSyl: starting to parse '%s'\n", d->d_name);
 
291
                        debug_print("RSSyl: starting to parse '%s'\n", d);
294
292
                        if( (item = rssyl_parse_folder_item_file(fname)) != NULL ) {
295
293
                                /* Find latest timestamp */
296
294
                                ctx = (RFeedCtx *)item->data;
303
301
                }
304
302
        }
305
303
 
306
 
        closedir(dp);
 
304
        g_dir_close(dp);
307
305
        g_free(path);
308
306
 
309
307
        ritem->items = g_slist_reverse(ritem->items);