Skip to content
Snippets Groups Projects
Commit 5da0c67d authored by Fredrik Noring's avatar Fredrik Noring
Browse files

Fixed bug in recursive_rm.

Rev: lib/modules/Stdio.pmod/module.pmod:1.80
parent aafea32e
Branches
Tags
No related merge requests found
// $Id: module.pmod,v 1.79 2000/03/27 12:28:07 grubba Exp $ // $Id: module.pmod,v 1.80 2000/06/22 13:13:12 noring Exp $
import String; import String;
...@@ -845,7 +845,10 @@ int mkdirhier (string dir, void|int mode) ...@@ -845,7 +845,10 @@ int mkdirhier (string dir, void|int mode)
int recursive_rm (string path) int recursive_rm (string path)
{ {
int res = 1; int res = 1;
if ( file_stat( path, 1 )[1] == -2 ) array a = file_stat(path, 1);
if(!a)
return 0;
if(a[1] == -2)
if (array(string) sub = get_dir (path)) if (array(string) sub = get_dir (path))
foreach( sub, string name ) foreach( sub, string name )
if (!recursive_rm (path + "/" + name)) if (!recursive_rm (path + "/" + name))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment