diff options
author | Jim Meyering <jim@meyering.net> | 2003-01-14 15:07:24 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-01-14 15:07:24 +0000 |
commit | cbe7e9daec1c908c9a21e8d3909366ad7cddbf15 (patch) | |
tree | 761e16733b52b615d024951ec44cf3dbcebaa614 /lib | |
parent | ee45aa56cb78cc814c2aa2e864c070703203b171 (diff) | |
download | coreutils-cbe7e9daec1c908c9a21e8d3909366ad7cddbf15.tar.xz |
(same_name): Declare *_basename locals to be `const'.
Consolidate declarations and initializations of *_base* locals.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/same.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/same.c b/lib/same.c index 8b4985de5..d41cccc46 100644 --- a/lib/same.c +++ b/lib/same.c @@ -64,14 +64,12 @@ void free (); int same_name (const char *source, const char *dest) { - char *source_basename, *dest_basename; - size_t source_baselen, dest_baselen; - /* Compare the basenames. */ - source_basename = base_name (source); - dest_basename = base_name (dest); - source_baselen = base_len (source_basename); - dest_baselen = base_len (dest_basename); + char const *source_basename = base_name (source); + char const *dest_basename = base_name (dest); + size_t source_baselen = base_len (source_basename); + size_t dest_baselen = base_len (dest_basename); + if (source_baselen == dest_baselen && memcmp (source_basename, dest_basename, dest_baselen) == 0) { |