- fix warnings for missing prototypes - use termios instead of sgtty (why doesn't this work on amd64?)
51 lines
1.6 KiB
Text
51 lines
1.6 KiB
Text
$NetBSD: patch-aa,v 1.2 2008/12/17 02:19:59 christos Exp $
|
|
|
|
--- glob/tilde.c.orig 1995-02-24 16:20:46.000000000 -0500
|
|
+++ glob/tilde.c 2008-12-16 20:35:03.000000000 -0500
|
|
@@ -28,12 +28,16 @@
|
|
#endif
|
|
|
|
#include <pwd.h>
|
|
+#include <string.h>
|
|
+#include <stdlib.h>
|
|
+#include <unistd.h>
|
|
|
|
#ifndef savestring
|
|
#define savestring(x) (char *)strcpy ((char *)xmalloc (1 + strlen (x)), (x))
|
|
#endif
|
|
|
|
typedef int Function ();
|
|
+typedef char *CPFunction ();
|
|
#if !defined (NULL)
|
|
# define NULL 0x0
|
|
#endif
|
|
@@ -41,7 +45,7 @@
|
|
#if defined (TEST)
|
|
static char *xmalloc (), *xrealloc ();
|
|
#else
|
|
-extern char *malloc (), *xrealloc ();
|
|
+extern char *xmalloc (), *xrealloc ();
|
|
#endif /* TEST */
|
|
|
|
/* The default value of tilde_additional_prefixes. This is set to
|
|
@@ -60,7 +64,7 @@
|
|
standard meaning for expanding a tilde fails. The function is called
|
|
with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
|
|
which is the expansion, or a NULL pointer if there is no expansion. */
|
|
-Function *tilde_expansion_failure_hook = (Function *)NULL;
|
|
+CPFunction *tilde_expansion_failure_hook = (CPFunction *)NULL;
|
|
|
|
/* When non-null, this is a NULL terminated array of strings which
|
|
are duplicates for a tilde prefix. Bash uses this to expand
|
|
@@ -207,9 +211,9 @@
|
|
if (!dirname[1] || dirname[1] == '/')
|
|
{
|
|
/* Prepend $HOME to the rest of the string. */
|
|
- char *temp_home = (char *)getenv ("HOME");
|
|
+ char *temp_home = getenv ("HOME");
|
|
|
|
- temp_name = (char *)alloca (1 + strlen (&dirname[1])
|
|
+ temp_name = alloca (1 + strlen (&dirname[1])
|
|
+ (temp_home? strlen (temp_home) : 0));
|
|
temp_name[0] = '\0';
|
|
if (temp_home)
|