cp: add -v, fix manpage info

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
This commit is contained in:
Hiltjo Posthuma
2014-07-10 20:30:30 +00:00
committed by sin
parent ac402965d5
commit f67320ce93
5 changed files with 15 additions and 5 deletions

View File

@@ -22,4 +22,3 @@ apathmax(char **p, long *size)
if(!(*p = malloc(*size)))
eprintf("malloc:");
}

View File

@@ -20,6 +20,7 @@ bool cp_dflag = false;
bool cp_fflag = false;
bool cp_pflag = false;
bool cp_rflag = false;
bool cp_vflag = false;
int
cp(const char *s1, const char *s2)
@@ -39,6 +40,9 @@ cp(const char *s1, const char *s2)
else
r = stat(s1, &st);
if(cp_vflag)
printf("'%s' -> '%s'\n", s1, s2);
if(r == 0) {
if(cp_dflag == true && S_ISLNK(st.st_mode)) {
if(cp_fflag == true)
@@ -86,7 +90,6 @@ cp(const char *s1, const char *s2)
free(ns1);
free(ns2);
goto preserve;
return 0;
}
}
if(!(f1 = fopen(s1, "r")))