summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c054dad)
raw | patch | inline | side by side (parent: c054dad)
author | pjrm <pjrm@users.sourceforge.net> | |
Tue, 7 Apr 2009 07:38:27 +0000 (07:38 +0000) | ||
committer | pjrm <pjrm@users.sourceforge.net> | |
Tue, 7 Apr 2009 07:38:27 +0000 (07:38 +0000) |
src/dir-util.cpp | patch | blob | history | |
src/dir-util.h | patch | blob | history | |
src/document.cpp | patch | blob | history |
diff --git a/src/dir-util.cpp b/src/dir-util.cpp
index 6beff22bf4c432cfdd5651455a4de48778b02b8e..67db036281324512c3d54df1155614ed73e7d284 100644 (file)
--- a/src/dir-util.cpp
+++ b/src/dir-util.cpp
return (NULL);
}
-void
-prepend_current_dir_if_relative (char **result, const gchar *uri)
+gchar *
+prepend_current_dir_if_relative(gchar const *uri)
{
if (!uri) {
- *(result) = NULL;
- return;
+ return NULL;
}
- char *full_path = (char *) g_malloc (1001);
- char *cwd = g_get_current_dir();
+ gchar *full_path = (gchar *) g_malloc (1001);
+ gchar *cwd = g_get_current_dir();
gsize bytesRead = 0;
gsize bytesWritten = 0;
&error);
inkscape_rel2abs (uri, cwd_utf8, full_path, 1000);
- *(result) = g_strdup (full_path);
+ gchar *ret = g_strdup (full_path);
g_free (full_path);
g_free (cwd);
+ return ret;
}
diff --git a/src/dir-util.h b/src/dir-util.h
index f7d75e8e40a7649f806a14a9ac4c490ef2d823d9..9bdfafa9ee52deeac1900a1458eee8ea5c7e706f 100644 (file)
--- a/src/dir-util.h
+++ b/src/dir-util.h
char const *sp_extension_from_path(char const *path);
char *inkscape_rel2abs(char const *path, char const *base, char *result, size_t const size);
char *inkscape_abs2rel(char const *path, char const *base, char *result, size_t const size);
-void prepend_current_dir_if_relative(char **result, gchar const *uri);
+gchar *prepend_current_dir_if_relative(gchar const *filename);
#endif /* !SEEN_DIR_UTIL_H */
diff --git a/src/document.cpp b/src/document.cpp
index 2a9014e3e3a91893d6fefce6aa7b917768d139d8..7dbfe0d2fb4fe5764ddfd8758de45dee331f05e5 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
document->rroot = rroot;
#ifndef WIN32
- prepend_current_dir_if_relative(&(document->uri), uri);
+ document->uri = prepend_current_dir_if_relative(uri);
#else
// FIXME: it may be that prepend_current_dir_if_relative works OK on windows too, test!
document->uri = uri? g_strdup(uri) : NULL;
if (uri) {
#ifndef WIN32
- prepend_current_dir_if_relative(&(document->uri), uri);
+ document->uri = prepend_current_dir_if_relative(uri);
#else
// FIXME: it may be that prepend_current_dir_if_relative works OK on windows too, test!
document->uri = g_strdup(uri);