summaryrefslogtreecommitdiffstats
path: root/src/dir-util.cpp
diff options
context:
space:
mode:
authorPeter Moulder <peter.moulder@monash.edu>2009-04-07 07:38:27 +0000
committerpjrm <pjrm@users.sourceforge.net>2009-04-07 07:38:27 +0000
commit6ad831cc22d5b5b7de0193b9a5cfbc56328e3282 (patch)
tree59b67f0348797415c5d521b0342e369f2ee8ffc1 /src/dir-util.cpp
parentnoop: whitespace (diff)
downloadinkscape-6ad831cc22d5b5b7de0193b9a5cfbc56328e3282.tar.gz
inkscape-6ad831cc22d5b5b7de0193b9a5cfbc56328e3282.zip
functional noop: Change prepend_current_dir_if_relative to return the result rather than taking a pointer to where to put the result. (Clarifies that the existing value isn't used.)
(bzr r7653)
Diffstat (limited to 'src/dir-util.cpp')
-rw-r--r--src/dir-util.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dir-util.cpp b/src/dir-util.cpp
index 6beff22bf..67db03628 100644
--- a/src/dir-util.cpp
+++ b/src/dir-util.cpp
@@ -252,16 +252,15 @@ erange:
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;
@@ -273,9 +272,10 @@ prepend_current_dir_if_relative (char **result, const gchar *uri)
&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;
}