-
-/*
- * trimcpy.c -- strip leading and trailing whitespace,
+/* trimcpy.c -- strip leading and trailing whitespace,
* -- replace internal whitespace with spaces,
* -- then return a copy.
*
* complete copyright information.
*/
-#include <h/mh.h>
-#include <h/utils.h>
+#include "h/mh.h"
+#include "h/utils.h"
char *
}
/* now return a copy */
- return getcpy(cp);
+ return mh_xstrdup(cp);
}
* complete copyright information.
*/
char *
-cpytrim (const char *sp) {
+cpytrim (const char *sp)
+{
char *dp;
char *cp;
/* skip over leading whitespace */
while (isspace ((unsigned char) *sp)) ++sp;
- dp = add (sp, NULL);
+ dp = mh_xstrdup(sp);
/* start at the end and zap trailing whitespace */
for (cp = dp + strlen (dp) - 1;
* complete copyright information.
*/
char *
-rtrim (char *sp) {
+rtrim (char *sp)
+{
char *cp;
/* start at the end and zap trailing whitespace */