struct elt *e, *ee;
struct stat st;
unsigned bad = 0;
+ dstr buf = DSTR_INIT;
/* --- Initialize stack pointer and path string --- */
/* --- Handle symbolic links specially --- */
if (S_ISLNK(st.st_mode)) {
- dstr buf = DSTR_INIT;
int i;
/* --- Resolve the link --- */
+ dstr_reset(&buf);
dstr_ensure(&buf, st.st_size + 1);
if ((i = readlink(d.buf, buf.buf, buf.sz)) < 0) {
report(cp, CP_ERROR, 0, d.buf, "can't readlink: %e");
else
pop();
ee = splitpath(buf.buf, ee);
- dstr_destroy(&buf);
continue;
}
}
popall();
+ dstr_destroy(&buf);
return (bad);
}