Replace getcpy() and strdup() with mh_xstrdup()
[mmh] / sbr / context_read.c
index 4475ca0..cfdcff2 100644 (file)
@@ -25,7 +25,7 @@
 */
 
 #include <h/mh.h>    /* mh internals */
-#include <h/utils.h> /* mh_free0() */
+#include <h/utils.h>
 #include <errno.h>   /* system call errors */
 #include <pwd.h>     /* structure for getpwuid() results */
 #include <unistd.h>
@@ -65,7 +65,7 @@ context_read(void)
        ** set mmhpath
        */
        if ((cp = getenv("MMH")) && *cp) {
-               mmhpath = getcpy(expanddir(cp));  /* rel to cwd */
+               mmhpath = mh_xstrdup(expanddir(cp));  /* rel to cwd */
                if (stat(mmhpath, &st) != -1 && (st.st_mode & S_IFDIR) == 0) {
                        adios(EX_CONFIG, NULL, "`%s' specified by your MMH environment variable is not a directory", cp);
                }
@@ -83,7 +83,7 @@ context_read(void)
        */
        if ((cp = getenv("MMHP")) && *cp) {
                if (*cp == '/') {
-                       defpath = getcpy(cp);
+                       defpath = mh_xstrdup(cp);
                } else {
                        defpath = concat(mmhpath, "/", cp, NULL);
                }
@@ -169,7 +169,7 @@ context_read(void)
        }
 
        if (*cp == '/') {
-               ctxpath = getcpy(cp);
+               ctxpath = mh_xstrdup(cp);
        } else {
                ctxpath = concat(mmhpath, "/", cp, NULL);
        }