{ NULL, 0 }
};
+char *version=VERSION;
+
/*
** static prototypes
*/
if (folder)
adios(EX_USAGE, NULL, "only one folder at a time!");
else
- folder = getcpy(expandfol(cp));
+ folder = mh_xstrdup(expandfol(cp));
} else if (*cp == '/' || *cp == '.') {
if (file)
adios(EX_USAGE, NULL, "only one file at a time!");
} while (*field && *field != '-');
- free(field);
+ mh_free0(&field);
fclose(fp);
return;
** a long path name.
*/
for (n=0, cp=field; (c=getc(fp)) != EOF; *cp++ = c) {
- if (c == '\n' && (c = getc(fp)) != ' ' &&
- c != '\t') {
- ungetc(c, fp);
+ if (c == '\n') {
+ ungetc((c = getc(fp)), fp);
+ if (c != ' ' && c != '\t') {
+ c = '\n';
+ break;
+ }
c = '\n';
- break;
}
if (++n >= field_size - 1) {
} while (*field && *field != '-');
- free(field);
+ mh_free0(&field);
fflush(tmp);
fflush(fp); /* The underlying fd will be closed by lkclose() */