(savedir): Declare DIR parameter to be const.
authorJim Meyering <jim@meyering.net>
Sat, 4 Oct 1997 01:43:58 +0000 (01:43 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 4 Oct 1997 01:43:58 +0000 (01:43 +0000)
Include savedir.h.

lib/savedir.c

index e6becc6..f4c0c12 100644 (file)
@@ -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
 /* 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
 
 #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 *stpcpy ();
 
 char *
 savedir (dir, name_size)
-     char *dir;
+     const char *dir;
      unsigned name_size;
 {
   DIR *dirp;