changeset 1051:af67c42d555a

(savedir): Declare DIR parameter to be const. Include savedir.h.
author Jim Meyering <jim@meyering.net>
date Sat, 04 Oct 1997 01:43:58 +0000
parents 40cb5df41b24
children 7fa4534226de
files lib/savedir.c
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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 <djm@gnu.ai.mit.edu>. */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
 #endif
 
 #include <sys/types.h>
 
 #ifdef HAVE_UNISTD_H
-#include <unistd.h>
+# include <unistd.h>
 #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 <stdlib.h>
-#include <string.h>
+# include <stdlib.h>
+# include <string.h>
 #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 *
 savedir (dir, name_size)
-     char *dir;
+     const char *dir;
      unsigned name_size;
 {
   DIR *dirp;