diff options
Diffstat (limited to 'gnu/usr.bin/texinfo/info/tilde.c')
-rw-r--r-- | gnu/usr.bin/texinfo/info/tilde.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/gnu/usr.bin/texinfo/info/tilde.c b/gnu/usr.bin/texinfo/info/tilde.c index 59d4fe6b6b7..121eec7c959 100644 --- a/gnu/usr.bin/texinfo/info/tilde.c +++ b/gnu/usr.bin/texinfo/info/tilde.c @@ -1,8 +1,8 @@ /* tilde.c -- tilde expansion code (~/foo := $HOME/foo). - $Id: tilde.c,v 1.3 2000/02/09 02:18:40 espie Exp $ + $Id: tilde.c,v 1.4 2006/07/17 16:12:36 espie Exp $ - Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 98, 99 - Free Software Foundation, Inc. + Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1996, 1998, 1999, + 2002, 2004 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 @@ -22,6 +22,7 @@ /* Include config.h before doing alloca. */ #include "info.h" +#include "tilde.h" #if defined (TEST) || defined (STATIC_MALLOC) static void *xmalloc (), *xrealloc (); @@ -59,9 +60,7 @@ char **tilde_additional_suffixes = default_suffixes; the tilde which starts the expansion. Place the length of the text which identified this tilde starter in LEN, excluding the tilde itself. */ static int -tilde_find_prefix (string, len) - char *string; - int *len; +tilde_find_prefix (char *string, int *len) { register int i, j, string_len; register char **prefixes = tilde_additional_prefixes; @@ -92,8 +91,7 @@ tilde_find_prefix (string, len) /* Find the end of a tilde expansion in STRING, and return the index of the character which ends the tilde definition. */ static int -tilde_find_suffix (string) - char *string; +tilde_find_suffix (char *string) { register int i, j, string_len; register char **suffixes = tilde_additional_suffixes; @@ -116,10 +114,9 @@ tilde_find_suffix (string) /* Return a new string which is the result of tilde expanding STRING. */ char * -tilde_expand (string) - char *string; +tilde_expand (char *string) { - char *result, *tilde_expand_word (); + char *result; int result_size, result_index; result_size = result_index = 0; @@ -179,8 +176,7 @@ tilde_expand (string) /* Do the work of tilde expansion on FILENAME. FILENAME starts with a tilde. If there is no expansion, call tilde_expansion_failure_hook. */ char * -tilde_expand_word (filename) - char *filename; +tilde_expand_word (char *filename) { char *dirname = filename ? xstrdup (filename) : NULL; @@ -236,9 +232,7 @@ tilde_expand_word (filename) expansion, then let them try. */ if (tilde_expansion_failure_hook) { - char *expansion; - - expansion = (*tilde_expansion_failure_hook) (username); + char *expansion = (*tilde_expansion_failure_hook) (username); if (expansion) { |