version 1.17, 2005/04/28 07:14:09 |
version 1.18, 2005/05/15 21:19:08 |
|
|
{ |
{ |
char frname[NFILEN], toname[NFILEN], *bufp; |
char frname[NFILEN], toname[NFILEN], *bufp; |
int stat; |
int stat; |
int off; |
size_t off; |
BUFFER *bp; |
BUFFER *bp; |
|
|
if (d_makename(curwp->w_dotp, frname, sizeof(frname)) != FALSE) { |
if (d_makename(curwp->w_dotp, frname, sizeof(frname)) != FALSE) { |
|
|
} |
} |
off = strlcpy(toname, curbp->b_fname, sizeof(toname)); |
off = strlcpy(toname, curbp->b_fname, sizeof(toname)); |
if (off >= sizeof(toname) - 1) { /* can't happen, really */ |
if (off >= sizeof(toname) - 1) { /* can't happen, really */ |
ewprintf("too long directory name"); |
ewprintf("Directory name too long"); |
return (FALSE); |
return (FALSE); |
} |
} |
if ((bufp = eread("Copy %s to: ", toname + off, sizeof(toname) - off, |
if ((bufp = eread("Copy %s to: ", toname + off, sizeof(toname) - off, |
|
|
d_rename(int f, int n) |
d_rename(int f, int n) |
{ |
{ |
char frname[NFILEN], toname[NFILEN], *bufp; |
char frname[NFILEN], toname[NFILEN], *bufp; |
int stat, off; |
int stat; |
|
size_t off; |
BUFFER *bp; |
BUFFER *bp; |
|
|
if (d_makename(curwp->w_dotp, frname, sizeof(frname)) != FALSE) { |
if (d_makename(curwp->w_dotp, frname, sizeof(frname)) != FALSE) { |
|
|
} |
} |
off = strlcpy(toname, curbp->b_fname, sizeof(toname)); |
off = strlcpy(toname, curbp->b_fname, sizeof(toname)); |
if (off >= sizeof(toname) - 1) { /* can't happen, really */ |
if (off >= sizeof(toname) - 1) { /* can't happen, really */ |
ewprintf("too long directory name"); |
ewprintf("Directory name too long"); |
return (FALSE); |
return (FALSE); |
} |
} |
if ((bufp = eread("Rename %s to: ", toname + off, |
if ((bufp = eread("Rename %s to: ", toname + off, |
|
|
d_create_directory(int f, int n) |
d_create_directory(int f, int n) |
{ |
{ |
char tocreate[MAXPATHLEN], *bufp; |
char tocreate[MAXPATHLEN], *bufp; |
ssize_t off; |
size_t off; |
BUFFER *bp; |
BUFFER *bp; |
|
|
off = strlcpy(tocreate, curbp->b_fname, sizeof(tocreate)); |
off = strlcpy(tocreate, curbp->b_fname, sizeof(tocreate)); |