Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 811) +++ trunk/src/main.c (revision 812) @@ -1419,6 +1419,14 @@ resolve_paths(&in, out, 1); } +char *resolve_path_inplace(char *in) +{ + char *out; + resolve_path(in, &out); + free(in); + return out; +} + /* ---------------------------------------------------------------------- * Figure out the canonical name of the executed program * and fix up the defaults for various paths Index: trunk/src/misc.h =================================================================== --- trunk/src/misc.h (revision 811) +++ trunk/src/misc.h (revision 812) @@ -147,5 +147,9 @@ /* Allocate *out and copy the path from in to out, replacing ~ with homedir */ void resolve_path(const char *in, char **out); +/* Same as resolve_path, but it returns the pointer to the new path and calls + free() on in */ +char *resolve_path_inplace(char *in); + #endif /* PCB_MISC_H */