From 6644be6d79d003e311110e743b4fa9019ef0c4b9 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 4 Oct 1997 01:43:58 +0000 Subject: [PATCH] (savedir): Declare DIR parameter to be const. Include savedir.h. --- lib/savedir.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/savedir.c b/lib/savedir.c index e6becc6673..f4c0c12ce1 100644 --- a/lib/savedir.c +++ b/lib/savedir.c @@ -1,5 +1,5 @@ /* savedir.c -- save the list of files in a directory in a string - Copyright (C) 1990 Free Software Foundation, Inc. + Copyright (C) 1990, 1997 Free Software Foundation, Inc. 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 @@ -18,13 +18,13 @@ /* Written by David MacKenzie . */ #ifdef HAVE_CONFIG_H -#include +# include #endif #include #ifdef HAVE_UNISTD_H -#include +# include #endif #if HAVE_DIRENT_H @@ -46,24 +46,26 @@ #ifdef CLOSEDIR_VOID /* Fake a return value. */ -#define CLOSEDIR(d) (closedir (d), 0) +# define CLOSEDIR(d) (closedir (d), 0) #else -#define CLOSEDIR(d) closedir (d) +# define CLOSEDIR(d) closedir (d) #endif #ifdef STDC_HEADERS -#include -#include +# include +# include #else char *malloc (); char *realloc (); #endif #ifndef NULL -#define NULL 0 +# define NULL 0 #endif char *stpcpy (); +#include "savedir.h" + /* Return a freshly allocated string containing the filenames in directory DIR, separated by '\0' characters; the end is marked by two '\0' characters in a row. @@ -73,7 +75,7 @@ char *stpcpy (); char * savedir (dir, name_size) - char *dir; + const char *dir; unsigned name_size; { DIR *dirp; -- 2.30.2