summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1992-11-01 03:30:09 +0000
committerJim Meyering <jim@meyering.net>1992-11-01 03:30:09 +0000
commit144b82c6c22abaa2a3247dc33b286662a7aa90d9 (patch)
treebbd19ca5dd38607ced11823281da205091b645d4 /src
parentcdb20814d2dbd70ac952285ebe01372f513849fd (diff)
downloadcoreutils-144b82c6c22abaa2a3247dc33b286662a7aa90d9.tar.gz
coreutils-144b82c6c22abaa2a3247dc33b286662a7aa90d9.tar.bz2
coreutils-144b82c6c22abaa2a3247dc33b286662a7aa90d9.zip
Give most file-scope variables the static attribute.
Diffstat (limited to 'src')
-rw-r--r--src/chgrp.c12
-rw-r--r--src/chmod.c8
-rw-r--r--src/chown.c14
-rw-r--r--src/cp.c34
-rw-r--r--src/dd.c58
-rw-r--r--src/df.c16
-rw-r--r--src/du.c28
-rw-r--r--src/install.c16
-rw-r--r--src/ln.c14
-rw-r--r--src/ls.c74
-rw-r--r--src/mkdir.c4
-rw-r--r--src/mkfifo.c2
-rw-r--r--src/mknod.c2
-rw-r--r--src/mv.c16
-rw-r--r--src/rm.c18
-rw-r--r--src/rmdir.c4
-rw-r--r--src/touch.c24
17 files changed, 172 insertions, 172 deletions
diff --git a/src/chgrp.c b/src/chgrp.c
index aeb638f0a..62358af1c 100644
--- a/src/chgrp.c
+++ b/src/chgrp.c
@@ -49,21 +49,21 @@ void usage ();
char *program_name;
/* If nonzero, change the ownership of directories recursively. */
-int recurse;
+static int recurse;
/* If nonzero, force silence (no error messages). */
-int force_silent;
+static int force_silent;
/* If nonzero, describe the files we process. */
-int verbose;
+static int verbose;
/* If nonzero, describe only owners or groups that change. */
-int changes_only;
+static int changes_only;
/* The name of the group to which ownership of the files is being given. */
-char *groupname;
+static char *groupname;
-struct option long_options[] =
+static struct option long_options[] =
{
{"recursive", 0, 0, 'R'},
{"changes", 0, 0, 'c'},
diff --git a/src/chmod.c b/src/chmod.c
index 1d44c38f7..efdc08cd1 100644
--- a/src/chmod.c
+++ b/src/chmod.c
@@ -45,16 +45,16 @@ void usage ();
char *program_name;
/* If nonzero, change the modes of directories recursively. */
-int recurse;
+static int recurse;
/* If nonzero, force silence (no error messages). */
-int force_silent;
+static int force_silent;
/* If nonzero, describe the modes we set. */
-int verbose;
+static int verbose;
/* If nonzero, describe only modes that change. */
-int changes_only;
+static int changes_only;
/* Parse the ASCII mode given on the command line into a linked list
of `struct mode_change' and apply that to each file argument. */
diff --git a/src/chown.c b/src/chown.c
index 2bc6987af..dca9ba6de 100644
--- a/src/chown.c
+++ b/src/chown.c
@@ -64,24 +64,24 @@ void usage ();
char *program_name;
/* If nonzero, change the ownership of directories recursively. */
-int recurse;
+static int recurse;
/* If nonzero, force silence (no error messages). */
-int force_silent;
+static int force_silent;
/* If nonzero, describe the files we process. */
-int verbose;
+static int verbose;
/* If nonzero, describe only owners or groups that change. */
-int changes_only;
+static int changes_only;
/* The name of the user to which ownership of the files is being given. */
-char *username;
+static char *username;
/* The name of the group to which ownership of the files is being given. */
-char *groupname;
+static char *groupname;
-struct option long_options[] =
+static struct option long_options[] =
{
{"recursive", 0, 0, 'R'},
{"changes", 0, 0, 'c'},
diff --git a/src/cp.c b/src/cp.c
index e84fd158b..f54a1e578 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -54,66 +54,66 @@ static int re_protect ();
/* A pointer to either lstat or stat, depending on
whether dereferencing of symlinks is done. */
-int (*xstat) ();
+static int (*xstat) ();
/* The invocation name of this program. */
char *program_name;
/* If nonzero, copy all files except directories and, if not dereferencing
them, symbolic links, as if they were regular files. */
-int flag_copy_as_regular = 1;
+static int flag_copy_as_regular = 1;
/* If nonzero, dereference symbolic links (copy the files they point to). */
-int flag_dereference = 1;
+static int flag_dereference = 1;
/* If nonzero, remove existing destination nondirectories. */
-int flag_force = 0;
+static int flag_force = 0;
/* If nonzero, create hard links instead of copying files.
Create destination directories as usual. */
-int flag_hard_link = 0;
+static int flag_hard_link = 0;
/* If nonzero, query before overwriting existing destinations
with regular files. */
-int flag_interactive = 0;
+static int flag_interactive = 0;
/* If nonzero, the command "cp x/e_file e_dir" uses "e_dir/x/e_file"
as its destination instead of the usual "e_dir/e_file." */
-int flag_path = 0;
+static int flag_path = 0;
/* If nonzero, give the copies the original files' permissions,
ownership, and timestamps. */
-int flag_preserve = 0;
+static int flag_preserve = 0;
/* If nonzero, copy directories recursively and copy special files
as themselves rather than copying their contents. */
-int flag_recursive = 0;
+static int flag_recursive = 0;
/* If nonzero, create symbolic links instead of copying files.
Create destination directories as usual. */
-int flag_symbolic_link = 0;
+static int flag_symbolic_link = 0;
/* If nonzero, when copying recursively, skip any subdirectories that are
on different filesystems from the one we started on. */
-int flag_one_file_system = 0;
+static int flag_one_file_system = 0;
/* If nonzero, do not copy a nondirectory that has an existing destination
with the same or newer modification time. */
-int flag_update = 0;
+static int flag_update = 0;
/* If nonzero, display the names of the files before copying them. */
-int flag_verbose = 0;
+static int flag_verbose = 0;
/* The error code to return to the system. */
-int exit_status = 0;
+static int exit_status = 0;
/* The bits to preserve in created files' modes. */
-int umask_kill;
+static int umask_kill;
/* This process's effective user ID. */
-uid_t myeuid;
+static uid_t myeuid;
-struct option long_opts[] =
+static struct option long_opts[] =
{
{"archive", 0, NULL, 'a'},
{"backup", 0, NULL, 'b'},
diff --git a/src/dd.c b/src/dd.c
index 222d077e0..dc8d85a7d 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -114,60 +114,60 @@ void write_output ();
char *program_name;
/* The name of the input file, or NULL for the standard input. */
-char *input_file = NULL;
+static char *input_file = NULL;
/* The input file descriptor. */
-int input_fd = 0;
+static int input_fd = 0;
/* The name of the output file, or NULL for the standard output. */
-char *output_file = NULL;
+static char *output_file = NULL;
/* The output file descriptor. */
-int output_fd = 1;
+static int output_fd = 1;
/* The number of bytes in which atomic reads are done. */
-long input_blocksize = -1;
+static long input_blocksize = -1;
/* The number of bytes in which atomic writes are done. */
-long output_blocksize = -1;
+static long output_blocksize = -1;
/* Conversion buffer size, in bytes. 0 prevents conversions. */
-long conversion_blocksize = 0;
+static long conversion_blocksize = 0;
/* Skip this many records of `input_blocksize' bytes before input. */
-long skip_records = 0;
+static long skip_records = 0;
/* Skip this many records of `output_blocksize' bytes before output. */
-long seek_record = 0;
+static long seek_record = 0;
/* Copy only this many records. <0 means no limit. */
-int max_records = -1;
+static int max_records = -1;
/* Bit vector of conversions to apply. */
-int conversions_mask = 0;
+static int conversions_mask = 0;
/* If nonzero, filter characters through the translation table. */
-int translation_needed = 0;
+static int translation_needed = 0;
/* Number of partial blocks written. */
-unsigned w_partial = 0;
+static unsigned w_partial = 0;
/* Number of full blocks written. */
-unsigned w_full = 0;
+static unsigned w_full = 0;
/* Number of partial blocks read. */
-unsigned r_partial = 0;
+static unsigned r_partial = 0;
/* Number of full blocks read. */
-unsigned r_full = 0;
+static unsigned r_full = 0;
/* Records truncated by conv=block. */
-unsigned r_truncate = 0;
+static unsigned r_truncate = 0;
/* Output representation of newline and space characters.
They change if we're converting to EBCDIC. */
-unsigned char newline_character = '\n';
-unsigned char space_character = ' ';
+static unsigned char newline_character = '\n';
+static unsigned char space_character = ' ';
struct conversion
{
@@ -175,7 +175,7 @@ struct conversion
int conversion;
};
-struct conversion conversions[] =
+static struct conversion conversions[] =
{
{"ascii", C_ASCII | C_TWOBUFS}, /* EBCDIC to ASCII. */
{"ebcdic", C_EBCDIC | C_TWOBUFS}, /* ASCII to EBCDIC. */
@@ -192,9 +192,9 @@ struct conversion conversions[] =
};
/* Translation table formed by applying successive transformations. */
-unsigned char trans_table[256];
+static unsigned char trans_table[256];
-unsigned char ascii_to_ebcdic[] =
+static unsigned char ascii_to_ebcdic[] =
{
0, 01, 02, 03, 067, 055, 056, 057,
026, 05, 045, 013, 014, 015, 016, 017,
@@ -230,7 +230,7 @@ unsigned char ascii_to_ebcdic[] =
0356, 0357, 0372, 0373, 0374, 0375, 0376, 0377
};
-unsigned char ascii_to_ibm[] =
+static unsigned char ascii_to_ibm[] =
{
0, 01, 02, 03, 067, 055, 056, 057,
026, 05, 045, 013, 014, 015, 016, 017,
@@ -266,7 +266,7 @@ unsigned char ascii_to_ibm[] =
0356, 0357, 0372, 0373, 0374, 0375, 0376, 0377
};
-unsigned char ebcdic_to_ascii[] =
+static unsigned char ebcdic_to_ascii[] =
{
0, 01, 02, 03, 0234, 011, 0206, 0177,
0227, 0215, 0216, 013, 014, 015, 016, 017,
@@ -433,10 +433,10 @@ translate_buffer (buf, nread)
/* If nonnzero, the last char from the previous call to `swab_buffer'
is saved in `saved_char'. */
-int char_is_saved = 0;
+static int char_is_saved = 0;
/* Odd char from previous call. */
-unsigned char saved_char;
+static unsigned char saved_char;
/* Swap NREAD bytes in BUF, plus possibly an initial char from the
previous call. If NREAD is odd, save the last char for the
@@ -478,13 +478,13 @@ swab_buffer (buf, nread)
}
/* Output buffer. */
-unsigned char *obuf;
+static unsigned char *obuf;
/* Current index into `obuf'. */
-int oc = 0;
+static int oc = 0;
/* Index into current line, for `conv=block' and `conv=unblock'. */
-int col = 0;
+static int col = 0;
/* The main loop. */
diff --git a/src/df.c b/src/df.c
index e13f1ce1d..6439a7ec5 100644
--- a/src/df.c
+++ b/src/df.c
@@ -51,20 +51,20 @@ void show_point ();
void usage ();
/* If nonzero, show inode information. */
-int inode_format;
+static int inode_format;
/* If nonzero, show even filesystems with zero size or
uninteresting types. */
-int show_all_fs;
+static int show_all_fs;
/* If nonzero, use 1K blocks instead of 512-byte blocks. */
-int kilobyte_blocks;
+static int kilobyte_blocks;
/* If nonzero, use the POSIX output format. */
-int posix_format;
+static int posix_format;
/* Nonzero if errors have occurred. */
-int exit_status;
+static int exit_status;
/* Name this program was run with. */
char *program_name;
@@ -88,12 +88,12 @@ struct fs_select
Some filesystem types:
4.2 4.3 ufs nfs swap ignore io vm */
-struct fs_select *fs_list;
+static struct fs_select *fs_list;
/* Linked list of mounted filesystems. */
-struct mount_entry *mount_list;
+static struct mount_entry *mount_list;
-struct option long_options[] =
+static struct option long_options[] =
{
{"all", 0, &show_all_fs, 1},
{"inodes", 0, &inode_format, 1},
diff --git a/src/du.c b/src/du.c
index 726b5d30e..10864bf01 100644
--- a/src/du.c
+++ b/src/du.c
@@ -107,25 +107,25 @@ void str_trunc ();
char *program_name;
/* If nonzero, display only a total for each argument. */
-int opt_summarize_only = 0;
+static int opt_summarize_only = 0;
/* If nonzero, display counts for all files, not just directories. */
-int opt_all = 0;
+static int opt_all = 0;
/* If nonzero, count each hard link of files with multiple links. */
-int opt_count_all = 0;
+static int opt_count_all = 0;
/* If nonzero, do not cross file-system boundaries. */
-int opt_one_file_system = 0;
+static int opt_one_file_system = 0;
/* If nonzero, print a grand total at the end. */
-int opt_combined_arguments = 0;
+static int opt_combined_arguments = 0;
/* If nonzero, do not add sizes of subdirectories. */
-int opt_separate_dirs = 0;
+static int opt_separate_dirs = 0;
/* If nonzero, dereference symlinks that are command line arguments. */
-int opt_dereference_arguments = 0;
+static int opt_dereference_arguments = 0;
enum output_size
{
@@ -135,26 +135,26 @@ enum output_size
};
/* The units to count in. */
-enum output_size output_size;
+static enum output_size output_size;
/* Accumulated path for file or directory being processed. */
-string path;
+static string path;
/* Pointer to hash structure, used by the hash routines. */
-struct htab *htab;
+static struct htab *htab;
/* Globally used stat buffer. */
-struct stat stat_buf;
+static struct stat stat_buf;
/* A pointer to either lstat or stat, depending on whether
dereferencing of all symbolic links is to be done. */
-int (*xstat) ();
+static int (*xstat) ();
/* The exit status to use if we don't get any fatal errors. */
-int exit_status;
+static int exit_status;
-struct option long_options[] =
+static struct option long_options[] =
{
{"all", 0, &opt_all, 1},
{"bytes", 0, NULL, 'b'},
diff --git a/src/install.c b/src/install.c
index 473ea6d39..881038c41 100644
--- a/src/install.c
+++ b/src/install.c
@@ -102,29 +102,29 @@ char *program_name;
/* The user name that will own the files, or NULL to make the owner
the current user ID. */
-char *owner_name;
+static char *owner_name;
/* The user ID corresponding to `owner_name'. */
-uid_t owner_id;
+static uid_t owner_id;
/* The group name that will own the files, or NULL to make the group
the current group ID. */
-char *group_name;
+static char *group_name;
/* The group ID corresponding to `group_name'. */
-gid_t group_id;
+static gid_t group_id;
/* The permissions to which the files will be set. The umask has
no effect. */
-int mode;
+static int mode;
/* If nonzero, strip executable files after copying them. */
-int strip_files;
+static int strip_files;
/* If nonzero, install a directory instead of a regular file. */
-int dir_arg;
+static int dir_arg;
-struct option long_options[] =
+static struct option long_options[] =
{
{"strip", 0, NULL, 's'},
{"directory", 0, NULL, 'd'},
diff --git a/src/ln.c b/src/ln.c
index 781a55d8b..d80d0cede 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -42,27 +42,27 @@ void usage ();
/* A pointer to the function used to make links. This will point to either
`link' or `symlink'. */
-int (*linkfunc) ();
+static int (*linkfunc) ();
/* If nonzero, make symbolic links; otherwise, make hard links. */
-int symbolic_link;
+static int symbolic_link;
/* If nonzero, ask the user before removing existing files. */
-int interactive;
+static int interactive;
/* If nonzero, remove existing files unconditionally. */
-int remove_existing_files;
+static int remove_existing_files;
/* If nonzero, list each file as it is moved. */
-int verbose;
+static int verbose;
/* If nonzero, allow the superuser to make hard links to directories. */
-int hard_dir_link;
+static int hard_dir_link;
/* The name by which the program was run, for error messages. */
char *program_name;
-struct option long_options[] =
+static struct option long_options[] =
{
{"backup", 0, NULL, 'b'},
{"directory", 0, &hard_dir_link, 1},
diff --git a/src/ls.c b/src/ls.c
index 24343a695..870c13066 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -144,15 +144,15 @@ struct file
/* Address of block containing the files that are described. */
-struct file *files;
+static struct file *files;
/* Length of block that `files' points to, measured in files. */
-int nfiles;
+static int nfiles;
/* Index of first unused in `files'. */
-int files_index;
+static int files_index;
/* Record of one pending directory waiting to be listed. */
@@ -166,17 +166,17 @@ struct pending
struct pending *next;
};
-struct pending *pending_dirs;
+static struct pending *pending_dirs;
/* Current time (seconds since 1970). When we are printing a file's time,
include the year if it is more than 6 months before this time. */
-time_t current_time;
+static time_t current_time;
/* The number of digits to use for block sizes.
4, or more if needed for bigger numbers. */
-int block_size_size;
+static int block_size_size;
/* The name the program was run with, stripped of any leading path. */
char *program_name;
@@ -200,7 +200,7 @@ enum format
with_commas /* -m */
};
-enum format format;
+static enum format format;
/* Type of time to print or sort by. Controlled by -c and -u. */
@@ -211,7 +211,7 @@ enum time_type
time_atime /* -u */
};
-enum time_type time_type;
+static enum time_type time_type;
/* The file characteristic to sort by. Controlled by -t, -S, -U, -X. */
@@ -224,7 +224,7 @@ enum sort_type
sort_size /* -S */
};
-enum sort_type sort_type;
+static enum sort_type sort_type;
/* Direction of sort.
0 means highest first if numeric,
@@ -232,21 +232,21 @@ enum sort_type sort_type;
these are the defaults.
1 means the opposite order in each case. -r */
-int sort_reverse;
+static int sort_reverse;
/* Nonzero means print the user and group id's as numbers rather
than as names. -n */
-int numeric_users;
+static int numeric_users;
/* Nonzero means mention the size in 512 byte blocks of each file. -s */
-int print_block_size;
+static int print_block_size;
/* Nonzero means show file sizes in kilobytes instead of blocks
(the size of which is system-dependant). -k */
-int kilobyte_blocks;
+static int kilobyte_blocks;
/* none means don't mention the type of files.
all means mention the types of all files.
@@ -261,35 +261,35 @@ enum indicator_style
not_programs /* -p */
};
-enum indicator_style indicator_style;
+static enum indicator_style indicator_style;
/* Nonzero means mention the inode number of each file. -i */
-int print_inode;
+static int print_inode;
/* Nonzero means when a symbolic link is found, display info on
the file linked to. -L */
-int trace_links;
+static int trace_links;
/* Nonzero means when a directory is found, display info on its
contents. -R */
-int trace_dirs;
+static int trace_dirs;
/* Nonzero means when an argument is a directory name, display info
on it itself. -d */
-int immediate_dirs;
+static int immediate_dirs;
/* Nonzero means don't omit files whose names start with `.'. -A */
-int all_files;
+static int all_files;
/* Nonzero means don't omit files `.' and `..'
This flag implies `all_files'. -a */
-int really_all_files;
+static int really_all_files;
/* A linked list of shell-style globbing patterns. If a non-argument
file name matches any of these patterns, it is omitted.
@@ -302,15 +302,15 @@ struct ignore_pattern
struct ignore_pattern *next;
};
-struct ignore_pattern *ignore_patterns;
+static struct ignore_pattern *ignore_patterns;
/* Nonzero means quote nongraphic chars in file names. -b */
-int quote_funny_chars;
+static int quote_funny_chars;
/* Nonzero means output nongraphic chars in file names as `?'. -q */
-int qmark_funny_chars;
+static int qmark_funny_chars;
/* Nonzero means output each file name using C syntax for a string.
Always accompanied by `quote_funny_chars'.
@@ -319,33 +319,33 @@ int qmark_funny_chars;
is guaranteed to make it possible for a program receiving
the output to tell exactly what file names are present. -Q */
-int quote_as_string;
+static int quote_as_string;
/* The number of chars per hardware tab stop. -T */
-int tabsize;
+static int tabsize;
/* Nonzero means we are listing the working directory because no
non-option arguments were given. */
-int dir_defaulted;
+static int dir_defaulted;
/* Nonzero means print each directory name before listing it. */
-int print_dir_name;
+static int print_dir_name;
/* The line length to use for breaking lines in many-per-line format.
Can be set with -w. */
-int line_length;
+static int line_length;
/* If nonzero, the file listing format requires that stat be called on
each file. */
-int format_needs_stat;
+static int format_needs_stat;
/* The exit status to use if we don't get any fatal errors. */
-int exit_status;
+static int exit_status;
void
main (argc, argv)
@@ -419,7 +419,7 @@ main (argc, argv)
exit (exit_status);
}
-struct option long_options[] =
+static struct option long_options[] =
{
{"all", 0, 0, 'a'},
{"escape", 0, 0, 'b'},
@@ -447,34 +447,34 @@ struct option long_options[] =
{0, 0, 0, 0}
};
-char *format_args[] =
+static char *format_args[] =
{
"verbose", "long", "commas", "horizontal", "across",
"vertical", "single-column", 0
};
-enum format formats[] =
+static enum format formats[] =
{
long_format, long_format, with_commas, horizontal, horizontal,
many_per_line, one_per_line
};
-char *sort_args[] =
+static char *sort_args[] =
{
"none", "time", "size", "extension", 0
};
-enum sort_type sort_types[] =
+static enum sort_type sort_types[] =
{
sort_none, sort_time, sort_size, sort_extension
};
-char *time_args[] =
+static char *time_args[] =
{
"atime", "access", "use", "ctime", "status", 0
};
-enum time_type time_types[] =
+static enum time_type time_types[] =
{
time_atime, time_atime, time_atime, time_ctime, time_ctime
};
diff --git a/src/mkdir.c b/src/mkdir.c
index 7a5d08a43..c60c5460f 100644
--- a/src/mkdir.c
+++ b/src/mkdir.c
@@ -38,12 +38,12 @@ void error ();
void usage ();
/* If nonzero, ensure that a path exists. */
-int path_mode;
+static int path_mode;
/* The name this program was run with. */
char *program_name;
-struct option longopts[] =
+static struct option longopts[] =
{
{"mode", 1, NULL, 'm'},
{"path", 0, &path_mode, 1},
diff --git a/src/mkfifo.c b/src/mkfifo.c
index 71a98cecd..24a943744 100644
--- a/src/mkfifo.c
+++ b/src/mkfifo.c
@@ -34,7 +34,7 @@ void usage ();
/* The name this program was run with. */
char *program_name;
-struct option longopts[] =
+static struct option longopts[] =
{
{"mode", 1, NULL, 'm'},
{NULL, 0, NULL, 0}
diff --git a/src/mknod.c b/src/mknod.c
index 1c582935d..d49070cbd 100644
--- a/src/mknod.c
+++ b/src/mknod.c
@@ -39,7 +39,7 @@ void usage ();
/* The name this program was run with. */
char *program_name;
-struct option longopts[] =
+static struct option longopts[] =
{
{"mode", 1, NULL, 'm'},
{NULL, 0, NULL, 0}
diff --git a/src/mv.c b/src/mv.c
index d7fcdcb16..cd95ec2f9 100644
--- a/src/mv.c
+++ b/src/mv.c
@@ -66,26 +66,26 @@ void usage ();
char *program_name;
/* If nonzero, query the user before overwriting files. */
-int interactive;
+static int interactive;
/* If nonzero, do not query the user before overwriting unwritable
files. */
-int override_mode;
+static int override_mode;
/* If nonzero, do not move a nondirectory that has an existing destination
with the same or newer modification time. */
-int update = 0;
+static int update = 0;
/* If nonzero, list each file as it is moved. */
-int verbose;
+static int verbose;
/* If nonzero, stdin is a tty. */
-int stdin_tty;
+static int stdin_tty;
/* This process's effective user ID. */
-uid_t myeuid;
+static uid_t myeuid;
-struct option long_options[] =
+static struct option long_options[] =
{
{"backup", 0, NULL, 'b'},
{"force", 0, NULL, 'f'},
@@ -193,7 +193,7 @@ movefile (source, dest)
return do_move (source, dest);
}
-struct stat dest_stats, source_stats;
+static struct stat dest_stats, source_stats;
/* Move SOURCE onto DEST. Handles cross-filesystem moves.
If DEST is a directory, SOURCE must be also.
diff --git a/src/rm.c b/src/rm.c
index b62fbbf07..7b98acdef 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -46,36 +46,36 @@ void strip_trailing_slashes ();
void usage ();
/* Path of file now being processed; extended as necessary. */
-char *pathname;
+static char *pathname;
/* Number of bytes currently allocated for `pathname';
made larger when necessary, but never smaller. */
-int pnsize;
+static int pnsize;
/* Name this program was run with. */
char *program_name;
/* If nonzero, display the name of each file removed. */
-int verbose;
+static int verbose;
/* If nonzero, ignore nonexistant files. */
-int ignore_missing_files;
+static int ignore_missing_files;
/* If nonzero, recursively remove directories. */
-int recursive;
+static int recursive;
/* If nonzero, query the user about whether to remove each file. */
-int interactive;
+static int interactive;
/* If nonzero, remove directories with unlink instead of rmdir, and don't
require a directory to be empty before trying to unlink it.
Only works for the super-user. */
-int unlink_dirs;
+static int unlink_dirs;
/* If nonzero, stdin is a tty. */
-int stdin_tty;
+static int stdin_tty;
-struct option long_opts[] =
+static struct option long_opts[] =
{
{"directory", 0, &unlink_dirs, 1},
{"force", 0, NULL, 'f'},
diff --git a/src/rmdir.c b/src/rmdir.c
index 59d2de71a..92ed8b1e9 100644
--- a/src/rmdir.c
+++ b/src/rmdir.c
@@ -33,12 +33,12 @@ void strip_trailing_slashes ();
void usage ();
/* If nonzero, remove empty parent directories. */
-int empty_paths;
+static int empty_paths;
/* The name this program was run with. */
char *program_name;
-struct option longopts[] =
+static struct option longopts[] =
{
{"path", 0, &empty_paths, 1},
{NULL, 0, NULL, 0}
diff --git a/src/touch.c b/src/touch.c
index fa2d033c2..8c2ee3126 100644
--- a/src/touch.c
+++ b/src/touch.c
@@ -61,38 +61,38 @@ int utime_now ();
#define CH_MTIME 2
/* Which timestamps to change. */
-int change_times;
+static int change_times;
/* (-c) If nonzero, don't create if not already there. */
-int no_create;
+static int no_create;
/* (-d) If nonzero, date supplied on command line in get_date formats. */
-int flexible_date;
+static int flexible_date;
/* (-r) If nonzero, use times from a reference file. */
-int use_ref;
+static int use_ref;
/* (-t) If nonzero, date supplied on command line in POSIX format. */
-int posix_date;
+static int posix_date;
/* If nonzero, the only thing we have to do is change both the
modification and access time to the current time, so we don't
have to own the file, just be able to read and write it. */
-int amtime_now;
+static int amtime_now;
/* New time to use when setting time. */
-time_t newtime;
+static time_t newtime;
/* File to use for -r. */
-char *ref_file;
+static char *ref_file;
/* Info about the reference file. */
-struct stat ref_stats;
+static struct stat ref_stats;
/* The name by which this program was run. */
char *program_name;
-struct option longopts[] =
+static struct option longopts[] =
{
{"time", 1, 0, 130},
{"no-create", 0, 0, 'c'},
@@ -102,13 +102,13 @@ struct option longopts[] =
};
/* Valid arguments to the `--time' option. */
-char *time_args[] =
+static char *time_args[] =
{
"atime", "access", "use", "mtime", "modify", 0
};
/* The bits in `change_times' that those arguments set. */
-int time_masks[] =
+static int time_masks[] =
{
CH_ATIME, CH_ATIME, CH_ATIME, CH_MTIME, CH_MTIME
};