summaryrefslogtreecommitdiff
path: root/lib/savedir.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-10-04 01:43:58 +0000
committerJim Meyering <jim@meyering.net>1997-10-04 01:43:58 +0000
commit5873623fd519968dc92a9287a86600209d920266 (patch)
tree02420a86c3bf3414083d5282ee65df7f14d02c02 /lib/savedir.c
parenta1faaa73d30cc442d246efe48e800d883c40450c (diff)
downloadcoreutils-5873623fd519968dc92a9287a86600209d920266.tar.xz
(savedir): Declare DIR parameter to be const.
Include savedir.h.
Diffstat (limited to 'lib/savedir.c')
-rw-r--r--lib/savedir.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/savedir.c b/lib/savedir.c
index e6becc667..f4c0c12ce 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 <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 *stpcpy ();
char *
savedir (dir, name_size)
- char *dir;
+ const char *dir;
unsigned name_size;
{
DIR *dirp;