summaryrefslogtreecommitdiff
path: root/tilde.c
diff options
context:
space:
mode:
Diffstat (limited to 'tilde.c')
-rw-r--r--tilde.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/tilde.c b/tilde.c
index d678a31..734b208 100644
--- a/tilde.c
+++ b/tilde.c
@@ -1,6 +1,6 @@
/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */
-/* Copyright (C) 1988-2020 Free Software Foundation, Inc.
+/* Copyright (C) 1988-2020,2023 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
@@ -68,14 +68,6 @@ extern struct passwd *getpwnam (const char *);
#define savestring(x) strcpy ((char *)xmalloc (1 + strlen (x)), (x))
#endif /* !savestring */
-#if !defined (NULL)
-# if defined (__STDC__)
-# define NULL ((void *) 0)
-# else
-# define NULL 0x0
-# endif /* !__STDC__ */
-#endif /* !NULL */
-
/* If being compiled as part of bash, these will be satisfied from
variables.o. If being compiled as part of readline, they will
be satisfied from shell.o. */
@@ -160,8 +152,9 @@ tilde_find_prefix (const char *string, int *len)
static int
tilde_find_suffix (const char *string)
{
- register int i, j, string_len;
- register char **suffixes;
+ int i, j;
+ size_t string_len;
+ char **suffixes;
suffixes = tilde_additional_suffixes;
string_len = strlen (string);
@@ -189,7 +182,7 @@ char *
tilde_expand (const char *string)
{
char *result;
- int result_size, result_index;
+ size_t result_size, result_index;
result_index = result_size = 0;
if (result = strchr (string, '~'))
@@ -200,7 +193,7 @@ tilde_expand (const char *string)
/* Scan through STRING expanding tildes as we come to them. */
while (1)
{
- register int start, end;
+ int start, end;
char *tilde_word, *expansion;
int len;
@@ -318,7 +311,7 @@ static char *
glue_prefix_and_suffix (char *prefix, const char *suffix, int suffind)
{
char *ret;
- int plen, slen;
+ size_t plen, slen;
plen = (prefix && *prefix) ? strlen (prefix) : 0;
slen = strlen (suffix + suffind);