aboutsummaryrefslogtreecommitdiffstats
path: root/src/relpath.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2021-04-11 18:23:21 +0100
committerPádraig Brady <P@draigBrady.com>2021-04-11 18:33:45 +0100
commitef772bf97f7ec577754cbb5b278504d83cf41a43 (patch)
treeb6553bdc35b4d08368d427dbb3bb790acf43129c /src/relpath.c
parentls: cache name width determination (diff)
downloadcoreutils-ef772bf97f7ec577754cbb5b278504d83cf41a43.tar.gz
coreutils-ef772bf97f7ec577754cbb5b278504d83cf41a43.zip
maint: use "char const *" rather than "const char *"
* cfg.mk (sc_prohibit-const-char): Add a new syntax-check to enforce this style. * *.[ch]: sed -i 's/const char \*/char const */g'
Diffstat (limited to 'src/relpath.c')
-rw-r--r--src/relpath.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/relpath.c b/src/relpath.c
index 87776161d..a1ec5737e 100644
--- a/src/relpath.c
+++ b/src/relpath.c
@@ -27,7 +27,7 @@
of canonical PATH1 and PATH2, ensuring only full path components
are matched. Return 0 on no match. */
static int _GL_ATTRIBUTE_PURE
-path_common_prefix (const char *path1, const char *path2)
+path_common_prefix (char const *path1, char const *path2)
{
int i = 0;
int ret = 0;
@@ -85,7 +85,7 @@ buffer_or_output (const char* str, char **pbuf, size_t *plen)
/* Output the relative representation if possible.
If BUF is non-NULL, write to that buffer rather than to stdout. */
bool
-relpath (const char *can_fname, const char *can_reldir, char *buf, size_t len)
+relpath (char const *can_fname, char const *can_reldir, char *buf, size_t len)
{
bool buf_err = false;
@@ -94,8 +94,8 @@ relpath (const char *can_fname, const char *can_reldir, char *buf, size_t len)
if (!common_index)
return false;
- const char *relto_suffix = can_reldir + common_index;
- const char *fname_suffix = can_fname + common_index;
+ char const *relto_suffix = can_reldir + common_index;
+ char const *fname_suffix = can_fname + common_index;
/* Skip over extraneous '/'. */
if (*relto_suffix == '/')