Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* lib: centralize MAX_PATH stuff
  • Loading branch information
djcb committed Aug 3, 2012
1 parent 2fcdcaf commit cf2b81c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 43 deletions.
10 changes: 0 additions & 10 deletions lib/mu-maildir.c
Expand Up @@ -28,16 +28,6 @@
#include <sys/stat.h>
#include <fcntl.h>

/* hopefully, the should get us a sane PATH_MAX */
#include <limits.h>
/* not all systems provide PATH_MAX in limits.h */
#ifndef PATH_MAX
#include <sys/param.h>
#ifndef PATH_MAX
#define PATH_MAX MAXPATHLEN
#endif /*!PATH_MAX */
#endif /*PATH_MAX */

#include <string.h>
#include <errno.h>
#include <glib/gprintf.h>
Expand Down
10 changes: 0 additions & 10 deletions lib/mu-msg-file.c
Expand Up @@ -26,16 +26,6 @@
#include <stdlib.h>
#include <ctype.h>

/* hopefully, the should get us a sane PATH_MAX */
#include <limits.h>
/* not all systems provide PATH_MAX in limits.h */
#ifndef PATH_MAX
#include <sys/param.h>
#ifndef PATH_MAX
#define PATH_MAX MAXPATHLEN
#endif /*!PATH_MAX */
#endif /*PATH_MAX */

#include <gmime/gmime.h>
#include "mu-util.h"
#include "mu-str.h"
Expand Down
15 changes: 2 additions & 13 deletions lib/mu-str.c
@@ -1,7 +1,6 @@
/* -*-mode: c; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-*/

/*
** Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2008-2012 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
Expand All @@ -19,7 +18,6 @@
**
*/


#if HAVE_CONFIG_H
#include "config.h"
#endif /*HAVE_CONFIG_H*/
Expand All @@ -31,16 +29,7 @@
#include <stdlib.h>
#include <stdio.h>

/* hopefully, this should get us a sane PATH_MAX */
#include <limits.h>
/* not all systems provide PATH_MAX in limits.h */
#ifndef PATH_MAX
#include <sys/param.h>
#ifndef PATH_MAX
#define PATH_MAX MAXPATHLEN
#endif /*!PATH_MAX*/
#endif /*PATH_MAX*/

#include "mu-util.h" /* PATH_MAX */
#include "mu-str.h"
#include "mu-msg-fields.h"

Expand Down
10 changes: 0 additions & 10 deletions lib/mu-util.c
Expand Up @@ -29,16 +29,6 @@
#include <wordexp.h> /* for shell-style globbing */
#include <stdlib.h>

/* hopefully, this should get us a sane PATH_MAX */
#include <limits.h>
/* not all systems provide PATH_MAX in limits.h */
#ifndef PATH_MAX
#include <sys/param.h>
#ifndef PATH_MAX
#define PATH_MAX MAXPATHLEN
#endif /*!PATH_MAX*/
#endif /*PATH_MAX*/

#include <string.h>
#include <locale.h> /* for setlocale() */

Expand Down
10 changes: 10 additions & 0 deletions lib/mu-util.h
Expand Up @@ -27,6 +27,16 @@
#include <dirent.h>
#include <sys/stat.h> /* for mode_t */

/* hopefully, this should get us a sane PATH_MAX */
#include <limits.h>
/* not all systems provide PATH_MAX in limits.h */
#ifndef PATH_MAX
#include <sys/param.h>
#ifndef PATH_MAX
#define PATH_MAX MAXPATHLEN
#endif /*!PATH_MAX*/
#endif /*PATH_MAX*/

G_BEGIN_DECLS

/**
Expand Down

0 comments on commit cf2b81c

Please sign in to comment.