Consolidate NAME_MAX

git-svn: trunk@1412
remotes/push_mirror/metadata
Nigel Horne 21 years ago
parent bf84235f58
commit becc5fc3d6
  1. 17
      clamav-devel/libclamav/blob.c
  2. 13
      clamav-devel/libclamav/blob.h
  3. 17
      clamav-devel/libclamav/mbox.c
  4. 20
      clamav-devel/libclamav/untar.c

@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
static char const rcsid[] = "$Id: blob.c,v 1.38 2005/03/18 08:34:35 nigelhorne Exp $"; static char const rcsid[] = "$Id: blob.c,v 1.39 2005/03/20 09:09:25 nigelhorne Exp $";
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
#include "clamav-config.h" #include "clamav-config.h"
@ -41,21 +41,6 @@ static char const rcsid[] = "$Id: blob.c,v 1.38 2005/03/18 08:34:35 nigelhorne E
#define NDEBUG /* map CLAMAV debug onto standard */ #define NDEBUG /* map CLAMAV debug onto standard */
#endif #endif
/* Maximum filenames under various systems */
#ifndef NAME_MAX /* e.g. Linux */
#ifdef MAXNAMELEN /* e.g. Solaris */
#define NAME_MAX MAXNAMELEN
#else
#ifdef FILENAME_MAX /* e.g. SCO */
#define NAME_MAX FILENAME_MAX
#endif
#endif
#endif
#ifndef O_BINARY #ifndef O_BINARY
#define O_BINARY 0 #define O_BINARY 0
#endif #endif

@ -63,4 +63,17 @@ const char *fileblobGetFilename(const fileblob *fb);
void fileblobAddData(fileblob *fb, const unsigned char *data, size_t len); void fileblobAddData(fileblob *fb, const unsigned char *data, size_t len);
void sanitiseName(char *name); void sanitiseName(char *name);
/* Maximum filenames under various systems */
#ifndef NAME_MAX /* e.g. Linux */
# ifdef MAXNAMELEN /* e.g. Solaris */
# define NAME_MAX MAXNAMELEN
# else
# ifdef FILENAME_MAX /* e.g. SCO */
# define NAME_MAX FILENAME_MAX
# else
# define NAME_MAX 256
# endif
# endif
#endif
#endif /*_BLOB_H*/ #endif /*_BLOB_H*/

@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
static char const rcsid[] = "$Id: mbox.c,v 1.229 2005/03/18 18:12:25 nigelhorne Exp $"; static char const rcsid[] = "$Id: mbox.c,v 1.230 2005/03/20 09:09:25 nigelhorne Exp $";
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
#include "clamav-config.h" #include "clamav-config.h"
@ -291,21 +291,6 @@ static const struct tableinit {
static pthread_mutex_t tables_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t tables_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif #endif
/* Maximum filenames under various systems */
#ifndef NAME_MAX /* e.g. Linux */
#ifdef MAXNAMELEN /* e.g. Solaris */
#define NAME_MAX MAXNAMELEN
#else
#ifdef FILENAME_MAX /* e.g. SCO */
#define NAME_MAX FILENAME_MAX
#endif
#endif
#endif
#ifndef O_BINARY #ifndef O_BINARY
#define O_BINARY 0 #define O_BINARY 0
#endif #endif

@ -21,6 +21,9 @@
* *
* Change History: * Change History:
* $Log: untar.c,v $ * $Log: untar.c,v $
* Revision 1.23 2005/03/20 09:09:25 nigelhorne
* Consolidate NAME_MAX
*
* Revision 1.22 2005/03/10 08:52:10 nigelhorne * Revision 1.22 2005/03/10 08:52:10 nigelhorne
* Tidy * Tidy
* *
@ -88,7 +91,7 @@
* First draft * First draft
* *
*/ */
static char const rcsid[] = "$Id: untar.c,v 1.22 2005/03/10 08:52:10 nigelhorne Exp $"; static char const rcsid[] = "$Id: untar.c,v 1.23 2005/03/20 09:09:25 nigelhorne Exp $";
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
@ -106,21 +109,6 @@ static char const rcsid[] = "$Id: untar.c,v 1.22 2005/03/10 08:52:10 nigelhorne
#define BLOCKSIZE 512 #define BLOCKSIZE 512
/* Maximum filenames under various systems */
#ifndef NAME_MAX /* e.g. Linux */
#ifdef MAXNAMELEN /* e.g. Solaris */
#define NAME_MAX MAXNAMELEN
#else
#ifdef FILENAME_MAX /* e.g. SCO */
#define NAME_MAX FILENAME_MAX
#endif
#endif
#endif
#ifndef O_BINARY #ifndef O_BINARY
#define O_BINARY 0 #define O_BINARY 0
#endif #endif

Loading…
Cancel
Save