projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add a test to test-scan-multibyte
[mmh]
/
uip
/
rmf.c
diff --git
a/uip/rmf.c
b/uip/rmf.c
index
230360b
..
273477e
100644
(file)
--- a/
uip/rmf.c
+++ b/
uip/rmf.c
@@
-7,6
+7,7
@@
*/
#include <h/mh.h>
*/
#include <h/mh.h>
+#include <h/utils.h>
#include <unistd.h>
#include <dirent.h>
#include <locale.h>
#include <unistd.h>
#include <dirent.h>
#include <locale.h>
@@
-24,6
+25,8
@@
static struct swit switches[] = {
{ NULL, 0 }
};
{ NULL, 0 }
};
+char *version=VERSION;
+
/*
** static prototypes
*/
/*
** static prototypes
*/
@@
-76,7
+79,7
@@
main(int argc, char **argv)
if (folder)
adios(EX_USAGE, NULL, "only one folder at a time!");
else
if (folder)
adios(EX_USAGE, NULL, "only one folder at a time!");
else
- folder = getcpy(expandfol(cp));
+ folder = mh_xstrdup(expandfol(cp));
} else {
adios(EX_USAGE, NULL, "usage: %s [+folder] [switches]",
invo_name);
} else {
adios(EX_USAGE, NULL, "usage: %s [+folder] [switches]",
invo_name);
@@
-110,7
+113,7
@@
main(int argc, char **argv)
cp = concat("Remove folder \"", folder, "\"? ", NULL);
if (!getanswer(cp))
exit(EX_OK);
cp = concat("Remove folder \"", folder, "\"? ", NULL);
if (!getanswer(cp))
exit(EX_OK);
- free(cp);
+ mh_free0(&cp);
}
if (rmf(folder) == OK) {
}
if (rmf(folder) == OK) {
@@
-223,7
+226,7
@@
rma(char *folder)
struct node *np, *pp;
alen = strlen("atr-");
struct node *np, *pp;
alen = strlen("atr-");
- plen = strlen(cp = getcpy(toabsdir(folder))) + 1;
+ plen = strlen(cp = mh_xstrdup(toabsdir(folder))) + 1;
/*
** Search context list for keys that look like
/*
** Search context list for keys that look like
@@
-248,5
+251,5
@@
rma(char *folder)
pp = np;
}
}
pp = np;
}
}
- free(cp);
+ mh_free0(&cp);
}
}