Imported from ../bash-2.05a.tar.gz.
[platform/upstream/bash.git] / builtins / alias.def
index 044b44d..e279d4d 100644 (file)
@@ -7,7 +7,7 @@ This file is part of GNU Bash, the Bourne Again SHell.
 
 Bash is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 1, or (at your option) any later
+Software Foundation; either version 2, or (at your option) any later
 version.
 
 Bash is distributed in the hope that it will be useful, but WITHOUT ANY
@@ -17,7 +17,7 @@ for more details.
 
 You should have received a copy of the GNU General Public License along
 with Bash; see the file COPYING.  If not, write to the Free Software
-Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA.
 
 $BUILTIN alias
 $FUNCTION alias_builtin
@@ -37,6 +37,9 @@ $END
 #if defined (ALIAS)
 
 #if defined (HAVE_UNISTD_H)
+#  ifdef _MINIX
+#    include <sys/types.h>
+#  endif
 #  include <unistd.h>
 #endif
 
@@ -48,8 +51,7 @@ $END
 #  include "common.h"
 #  include "bashgetopt.h"
 
-extern int interactive;
-static void print_alias ();
+static void print_alias __P((alias_t *));
 
 /* Hack the alias command in a Korn shell way. */
 int
@@ -80,12 +82,12 @@ alias_builtin (list)
   if (list == 0 || pflag)
     {
       if (aliases == 0)
-       return (EXECUTION_FAILURE);
+       return (EXECUTION_SUCCESS);
 
       alias_list = all_aliases ();
 
       if (alias_list == 0)
-       return (EXECUTION_FAILURE);
+       return (EXECUTION_SUCCESS);
 
       for (offset = 0; alias_list[offset]; offset++)
        print_alias (alias_list[offset]);
@@ -118,8 +120,7 @@ alias_builtin (list)
            print_alias (t);
          else
            {
-             if (interactive)
-               builtin_error ("`%s' not found", name);
+             builtin_error ("`%s' not found", name);
              any_failed++;
            }
        }
@@ -179,9 +180,7 @@ unalias_builtin (list)
        remove_alias (alias->name);
       else
        {
-         if (interactive)
-           builtin_error ("`%s': not an alias", list->word->word);
-
+         builtin_error ("`%s': not an alias", list->word->word);
          aflag++;
        }
 
@@ -198,7 +197,7 @@ print_alias (alias)
 {
   char *value;
 
-  value = single_quote (alias->value);
+  value = sh_single_quote (alias->value);
   printf ("alias %s=%s\n", alias->name, value);
   free (value);