Skip to content
Snippets Groups Projects
Commit 6e112444 authored by rswindell's avatar rswindell
Browse files

mv() no longer uses rename() on Unix. Need to determine if on the same mount.

parent 824081b8
No related branches found
No related tags found
No related merge requests found
......@@ -2135,6 +2135,7 @@ int sbbs_t::mv(char *src, char *dest, char copy)
bprintf("\r\n\7MV ERROR: Destination already exists\r\n'%s'\r\n"
,dest);
return(-1); }
#ifndef __unix__ /* need to determine if on same mount device */
if(!copy && ((src[1]!=':' && dest[1]!=':')
|| (src[1]==':' && dest[1]==':' && toupper(src[0])==toupper(dest[0])))) {
if(rename(src,dest)) { /* same drive, so move */
......@@ -2142,6 +2143,7 @@ int sbbs_t::mv(char *src, char *dest, char copy)
"\r\n to '%s'\r\n\7",src,dest);
return(-1); }
return(0); }
#endif
attr(WHITE);
if((ind=nopen(src,O_RDONLY))==-1) {
errormsg(WHERE,ERR_OPEN,src,O_RDONLY);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment