~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to libgimpthumb/gimpthumb-utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <errno.h>
29
29
#include <string.h>
30
30
#include <sys/types.h>
31
 
#include <sys/stat.h>
 
31
 
32
32
#ifdef HAVE_UNISTD_H
33
33
#include <unistd.h>
34
34
#endif
35
35
 
36
36
#include <glib-object.h>
 
37
#include <glib/gstdio.h>
37
38
 
38
39
#ifdef G_OS_WIN32
39
40
#include "libgimpbase/gimpwin32-io.h"
51
52
static gint           gimp_thumb_size       (GimpThumbSize  size);
52
53
static gchar        * gimp_thumb_png_lookup (const gchar   *name,
53
54
                                             const gchar   *basedir,
54
 
                                             GimpThumbSize *size);
 
55
                                             GimpThumbSize *size) G_GNUC_MALLOC;
55
56
static const gchar  * gimp_thumb_png_name   (const gchar   *uri);
56
57
static void           gimp_thumb_exit       (void);
57
58
 
119
120
        }
120
121
      else
121
122
        {
122
 
          gchar *name =
123
 
            g_filename_to_utf8 (g_get_tmp_dir (), -1, NULL, NULL, NULL);
 
123
          gchar *name = g_filename_display_name (g_get_tmp_dir ());
124
124
 
125
125
          g_message (_("Cannot determine a valid home directory.\n"
126
126
                       "Thumbnails will be stored in the folder for "
233
233
    return TRUE;
234
234
 
235
235
  if (g_file_test (thumb_dir, G_FILE_TEST_IS_DIR) ||
236
 
      (mkdir (thumb_dir, S_IRUSR | S_IWUSR | S_IXUSR) == 0))
 
236
      (g_mkdir (thumb_dir, S_IRUSR | S_IWUSR | S_IXUSR) == 0))
237
237
    {
238
238
      if (size == 0)
239
 
        mkdir (thumb_fail_subdir, S_IRUSR | S_IWUSR | S_IXUSR);
 
239
        g_mkdir (thumb_fail_subdir, S_IRUSR | S_IWUSR | S_IXUSR);
240
240
 
241
 
      mkdir (thumb_subdirs[size], S_IRUSR | S_IWUSR | S_IXUSR);
 
241
      g_mkdir (thumb_subdirs[size], S_IRUSR | S_IWUSR | S_IXUSR);
242
242
    }
243
243
 
244
244
  if (g_file_test (thumb_subdirs[size], G_FILE_TEST_IS_DIR))
299
299
  basedir = g_build_filename (dirname, ".thumblocal", NULL);
300
300
 
301
301
  if (g_file_test (basedir, G_FILE_TEST_IS_DIR) ||
302
 
      (mkdir (thumb_dir, S_IRUSR | S_IWUSR | S_IXUSR) == 0))
 
302
      (g_mkdir (thumb_dir, S_IRUSR | S_IWUSR | S_IXUSR) == 0))
303
303
    {
304
 
      mkdir (subdir, S_IRUSR | S_IWUSR | S_IXUSR);
 
304
      g_mkdir (subdir, S_IRUSR | S_IWUSR | S_IXUSR);
305
305
    }
306
306
 
307
307
  g_free (basedir);
487
487
 
488
488
  g_return_val_if_fail (filename != NULL, FALSE);
489
489
 
490
 
  if (stat (filename, &s) == 0)
 
490
  if (g_stat (filename, &s) == 0)
491
491
    {
492
492
      if (mtime)  *mtime  = s.st_mtime;
493
493
      if (size)   *size   = s.st_size;
535
535
 
536
536
      if (filename)
537
537
        {
538
 
          unlink (filename);
 
538
          g_unlink (filename);
539
539
          g_free (filename);
540
540
        }
541
541
    }
564
564
 
565
565
      if (filename)
566
566
        {
567
 
          unlink (filename);
 
567
          g_unlink (filename);
568
568
          g_free (filename);
569
569
        }
570
570
    }
591
591
      filename = gimp_thumb_name_from_uri (uri, thumb_sizes[i]);
592
592
      if (filename)
593
593
        {
594
 
          unlink (filename);
 
594
          g_unlink (filename);
595
595
          g_free (filename);
596
596
        }
597
597
    }