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.16 by root, Thu May 17 21:32:08 2007 UTC

1/* 1/*
2 * CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team 4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (C) 1992 Frank Tore Johansen
7 * 7 *
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