ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/porting.C
(Generate patch)

Comparing deliantra/server/common/porting.C (file contents):
Revision 1.13 by pippijn, Mon Jan 15 21:06:18 2007 UTC vs.
Revision 1.15 by pippijn, Thu Mar 1 12:28:16 2007 UTC

47 47
48#include <unistd.h> 48#include <unistd.h>
49 49
50/* Has to be after above includes so we don't redefine some values */ 50/* Has to be after above includes so we don't redefine some values */
51#include "global.h" 51#include "global.h"
52
53static unsigned int curtmp = 0;
54 52
55/* This function removes everything in the directory. */ 53/* This function removes everything in the directory. */
56void 54void
57remove_directory (const char *path) 55remove_directory (const char *path)
58{ 56{
180 char buf[MAX_BUF], *cp = buf; 178 char buf[MAX_BUF], *cp = buf;
181 struct stat statbuf; 179 struct stat statbuf;
182 180
183 if (!filename || !*filename) 181 if (!filename || !*filename)
184 return; 182 return;
183
185 strcpy (buf, filename); 184 assign (buf, filename);
186 185
187 while ((cp = strchr (cp + 1, (int) '/'))) 186 while ((cp = strchr (cp + 1, (int) '/')))
188 { 187 {
189 *cp = '\0'; 188 *cp = '\0';
190 if (stat (buf, &statbuf) || !S_ISDIR (statbuf.st_mode)) 189 if (stat (buf, &statbuf) || !S_ISDIR (statbuf.st_mode))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines