diff --git a/src/dir-util.cpp b/src/dir-util.cpp
index b83eec00283d92641250186448f2772f363a79a0..6beff22bf4c432cfdd5651455a4de48778b02b8e 100644 (file)
--- a/src/dir-util.cpp
+++ b/src/dir-util.cpp
-/** \file Some utility functions for filenames. */
+/** @file
+ * @brief Utility functions for filenames
+ */
#define DIR_UTIL_C
#include <errno.h>
-#include <string.h>
+#include <string>
+#include <cstring>
#include <glib/gutils.h>
#include <glib/gmem.h>
#include <glib/gerror.h>
\comment
based on functions by Shigio Yamaguchi.
- FIXME:TODO: force it to also do path normalization of the entire resulting path,
- i.e. get rid of any .. and . in any place, even if 'path' is already absolute
+ FIXME:TODO: force it to also do path normalization of the entire resulting path,
+ i.e. get rid of any .. and . in any place, even if 'path' is already absolute
(now it returns it unchanged in this case)
*/
@@ -205,8 +208,8 @@ inkscape_abs2rel (const char *path, const char *base, char *result, const size_t
for (pp = path, bp = base; *pp && *bp && *pp == *bp; pp++, bp++)
if (*pp == G_DIR_SEPARATOR)
branch = pp;
- if ((*pp == 0 || *pp == G_DIR_SEPARATOR && *(pp + 1) == 0) &&
- (*bp == 0 || *bp == G_DIR_SEPARATOR && *(bp + 1) == 0))
+ if (((*pp == 0) || ((*pp == G_DIR_SEPARATOR) && (*(pp + 1) == 0))) &&
+ ((*bp == 0) || ((*bp == G_DIR_SEPARATOR) && (*(bp + 1) == 0))))
{
rp = result;
*rp++ = '.';
@@ -217,7 +220,7 @@ inkscape_abs2rel (const char *path, const char *base, char *result, const size_t
*rp = 0;
goto finish;
}
- if (*pp == 0 && *bp == G_DIR_SEPARATOR || *pp == G_DIR_SEPARATOR && *bp == 0)
+ if (((*pp == 0) && (*bp == G_DIR_SEPARATOR)) || ((*pp == G_DIR_SEPARATOR) && (*bp == 0)))
branch = pp;
/* up to root. */
rp = result;