summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-04-25 23:24:23 +0200
committerDan McGee <dan@archlinux.org>2007-04-26 20:34:41 +0200
commit97313ba31645796148c3f413d9ebde365df06dbe (patch)
tree95a937c665c4ecb57c21df645292c616451794ae /src/pacman/util.c
parentda3286a80d10ea3896ae09e9e753dc4f19fa3bf6 (diff)
downloadpacman-97313ba31645796148c3f413d9ebde365df06dbe.tar.gz
pacman-97313ba31645796148c3f413d9ebde365df06dbe.tar.xz
More pacman side cleanup
* Cleaned up more of the header #includes, and got rid of a lot of stuff that was due to trying to make it compile on BSD/Darwin/CYGWIN. We can add it later but lets keep it simple for now and do it in seperate files if possible later. * Removed a lot of #define MACROS. Some were not even used, and others were only used a few times. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r--src/pacman/util.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 1fb6ead9..a7259e25 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -21,10 +21,6 @@
#include "config.h"
-#if defined(__APPLE__) || defined(__OpenBSD__)
-#include <sys/syslimits.h>
-#include <sys/stat.h>
-#endif
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/time.h>
@@ -37,9 +33,6 @@
#include <ctype.h>
#include <dirent.h>
#include <unistd.h>
-#ifdef CYGWIN
-#include <limits.h> /* PATH_MAX */
-#endif
#include <alpm.h>
#include <alpm_list.h>
@@ -88,7 +81,7 @@ int getcols()
int makepath(char *path)
{
char *orig, *str, *ptr;
- char full[PATH_MAX] = "";
+ char full[PATH_MAX+1] = "";
mode_t oldmask;
oldmask = umask(0000);
@@ -99,6 +92,7 @@ int makepath(char *path)
if(strlen(ptr)) {
struct stat buf;
+ /* TODO we should use strncat */
strcat(full, "/");
strcat(full, ptr);
if(stat(full, &buf)) {