diff options
author | Tor Lillqvist <tml@novell.com> | 2005-11-25 23:43:24 +0800 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-11-25 23:43:24 +0800 |
commit | f7750eddc35b618c2166004fe020a33a82b31792 (patch) | |
tree | ac3abfa58acd4327338ff502f31e2d78ee8d2f89 /addressbook/importers/evolution-ldif-importer.c | |
parent | e52ac86fca49e157eb21af1c68099301a7714998 (diff) | |
download | gsoc2013-evolution-f7750eddc35b618c2166004fe020a33a82b31792.tar.gz gsoc2013-evolution-f7750eddc35b618c2166004fe020a33a82b31792.tar.zst gsoc2013-evolution-f7750eddc35b618c2166004fe020a33a82b31792.zip |
Use g_filename_from_uri() instead of just stripping off the "file://"
2005-11-25 Tor Lillqvist <tml@novell.com>
* importers/evolution-ldif-importer.c (ldif_import): Use
g_filename_from_uri() instead of just stripping off the "file://"
prefix for Win32 portability. Use gstdio wrappers for better
non-ASCII filename support on Windows.
svn path=/trunk/; revision=30673
Diffstat (limited to 'addressbook/importers/evolution-ldif-importer.c')
-rw-r--r-- | addressbook/importers/evolution-ldif-importer.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index e37d579726..dfec5dfc51 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -23,6 +23,7 @@ #include <string.h> #include <glib/gi18n.h> +#include <glib/gstdio.h> #include <gtk/gtkvbox.h> @@ -690,8 +691,9 @@ ldif_import(EImport *ei, EImportTarget *target, EImportImporter *im) { LDIFImporter *gci; EBook *book; - FILE *file; + FILE *file = NULL; EImportTargetURI *s = (EImportTargetURI *)target; + gchar *filename; book = e_book_new(g_datalist_get_data(&target->data, "ldif-source"), NULL); if (book == NULL) { @@ -700,7 +702,11 @@ ldif_import(EImport *ei, EImportTarget *target, EImportImporter *im) return; } - file = fopen(s->uri_src+7, "r"); + filename = g_filename_from_uri(s->uri_src, NULL, NULL); + if (filename != NULL) { + file = g_fopen(filename, "r"); + g_free (filename); + } if (file == NULL) { g_message(G_STRLOC ":Can't open .ldif file"); e_import_complete(ei, target); |