[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Removing remove bug
Ok. Here is attempt two to send the remove bug patch. Apparently
majordomo was setup to convert tabs into spaces which break the patch
file. This is hopefully fixed now.
Dennis Payne
payned@rpi.edu
--- ../xwpe-1.5.5a/we_fl_unix.c Tue Mar 24 14:28:51 1998
+++ we_fl_unix.c Mon Mar 23 23:15:13 1998
@@ -1215,14 +1215,17 @@
{ e_ret_wastefile(file, tmp);
ret = strlen(tmp);
if(strncmp(tmp, file, ret))
- { e_rename(file, tmp, f); return(0); }
+ { e_rename(file, tmp, f); }
}
- if(f->ed->flopt & 0200)
- { sprintf(tmp, "Remove File:\n%s", file);
- ret = e_message(1, tmp, f);
+ else
+ {
+ if(f->ed->flopt & 0200)
+ { sprintf(tmp, "Remove File:\n%s", file);
+ ret = e_message(1, tmp, f);
+ }
+ else ret = 'Y';
+ if(ret == 'Y') remove(file);
}
- else ret = 'Y';
- if(ret == 'Y') remove(file);
}
else e_remove_dir(file, f->ed->fd.file, f, 0);
WpeMouseRestoreShape();
@@ -1438,7 +1441,14 @@
{ if(sw == 1) fk_copy(file, newname);
#ifndef DJGPP
else if(sw == 2) fk_link(file, newname, f->ed->flopt & 0400);
- else if(sw == 0 && ln < 0) fk_rename(file, newname);
+ else if(sw == 0 && ln < 0)
+ {
+ if ((fk_rename(file, newname) == -1) && (errno == EXDEV))
+ {
+ fk_copy(file, newname);
+ remove(file);
+ }
+ }
else if(sw == 0)
{ tmpl[ln] = '\0';
for( ; ln >= 0 && tmpl[ln] != DIRC; ln--);