mirror of https://github.com/djcb/mu.git
* mu_util_dir_expand fix issue #30: wrong use of realpath(3)
This commit is contained in:
parent
46ba5e3a1b
commit
6a3decdc7c
|
@ -56,7 +56,7 @@ do_wordexp (const char *path)
|
||||||
char *dir;
|
char *dir;
|
||||||
|
|
||||||
if (!path) {
|
if (!path) {
|
||||||
g_debug ("%s: path is empty", __FUNCTION__);
|
/* g_debug ("%s: path is empty", __FUNCTION__); */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,10 +94,10 @@ mu_util_dir_expand (const char *path)
|
||||||
if (!dir)
|
if (!dir)
|
||||||
return NULL; /* error */
|
return NULL; /* error */
|
||||||
|
|
||||||
/* now, resolve any symlinks, .. etc. */
|
/* now resolve any symlinks, .. etc. */
|
||||||
if (!realpath (dir, resolved)) {
|
if (realpath (dir, resolved) == NULL) {
|
||||||
/* g_debug ("%s: could not get realpath for '%s': %s", */
|
g_debug ("%s: could not get realpath for '%s': %s",
|
||||||
/* __FUNCTION__, dir, strerror(errno)); */
|
__FUNCTION__, dir, strerror(errno));
|
||||||
g_free (dir);
|
g_free (dir);
|
||||||
return NULL;
|
return NULL;
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -33,7 +33,8 @@ G_BEGIN_DECLS
|
||||||
gboolean mu_util_init_system (void);
|
gboolean mu_util_init_system (void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the expanded path; ie. perform shell expansion on the path
|
* get the expanded path; ie. perform shell expansion on the path. the
|
||||||
|
* path does not have to exist
|
||||||
*
|
*
|
||||||
* @param path path to expand
|
* @param path path to expand
|
||||||
*
|
*
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#if HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif /*HAVE_CONFIG_H*/
|
#endif /*HAVE_CONFIG_H*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue