Release Time. Synchronize with OpenBSD 3.4-current (base system).
This commit is contained in:
parent
fefa8b20a6
commit
2bfc0acc6d
7
emacs.c
7
emacs.c
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: emacs.c,v 1.26 2003/08/27 14:56:11 fgsch Exp $ */
|
/* $OpenBSD: emacs.c,v 1.27 2003/09/01 15:47:40 naddy Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Emacs-like command line editing and history
|
* Emacs-like command line editing and history
|
||||||
|
@ -25,7 +25,7 @@ static Area aedit;
|
||||||
#define CTRL(x) ((x) == '?' ? 0x7F : (x) & 0x1F) /* ASCII */
|
#define CTRL(x) ((x) == '?' ? 0x7F : (x) & 0x1F) /* ASCII */
|
||||||
#define UNCTRL(x) ((x) == 0x7F ? '?' : (x) | 0x40) /* ASCII */
|
#define UNCTRL(x) ((x) == 0x7F ? '?' : (x) | 0x40) /* ASCII */
|
||||||
#define META(x) ((x) & 0x7f)
|
#define META(x) ((x) & 0x7f)
|
||||||
#define ISMETA(x) (x_usemeta && ((x) & 0x80))
|
#define ISMETA(x) (Flag(FEMACSUSEMETA) && ((x) & 0x80))
|
||||||
|
|
||||||
|
|
||||||
/* values returned by keyboard functions */
|
/* values returned by keyboard functions */
|
||||||
|
@ -101,7 +101,6 @@ static int x_col;
|
||||||
static int x_displen;
|
static int x_displen;
|
||||||
static int x_arg; /* general purpose arg */
|
static int x_arg; /* general purpose arg */
|
||||||
static int x_arg_defaulted;/* x_arg not explicitly set; defaulted to 1 */
|
static int x_arg_defaulted;/* x_arg not explicitly set; defaulted to 1 */
|
||||||
static int x_usemeta; /* no 8-bit ascii, meta = ESC */
|
|
||||||
|
|
||||||
static int xlp_valid;
|
static int xlp_valid;
|
||||||
/* end from 4.9 edit.h } */
|
/* end from 4.9 edit.h } */
|
||||||
|
@ -1534,7 +1533,7 @@ x_init_emacs()
|
||||||
*/
|
*/
|
||||||
locale = setlocale(LC_CTYPE, NULL);
|
locale = setlocale(LC_CTYPE, NULL);
|
||||||
if (locale == NULL || !strcmp(locale, "C") || !strcmp(locale, "POSIX"))
|
if (locale == NULL || !strcmp(locale, "C") || !strcmp(locale, "POSIX"))
|
||||||
x_usemeta = 1;
|
Flag(FEMACSUSEMETA) = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bind_if_not_bound(int p, int k, int func);
|
static void bind_if_not_bound(int p, int k, int func);
|
||||||
|
|
38
ksh.1tbl
38
ksh.1tbl
|
@ -1,4 +1,4 @@
|
||||||
.\" $OpenBSD: ksh.1tbl,v 1.55 2003/07/19 08:07:35 jmc Exp $
|
.\" $OpenBSD: ksh.1tbl,v 1.58 2003/09/04 14:21:43 jmc Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1980, 1990, 1993
|
.\" Copyright (c) 1980, 1990, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
|
@ -284,7 +284,7 @@ shell and must be quoted if they are to represent themselves:
|
||||||
.Ql { ,
|
.Ql { ,
|
||||||
.Ql } ,
|
.Ql } ,
|
||||||
.Ql * ,
|
.Ql * ,
|
||||||
.Ql ? ,
|
.Ql \&? ,
|
||||||
and
|
and
|
||||||
.Ql [ .
|
.Ql [ .
|
||||||
The first three of these are the above mentioned quoting characters (see
|
The first three of these are the above mentioned quoting characters (see
|
||||||
|
@ -317,7 +317,7 @@ style alterations (see
|
||||||
below);
|
below);
|
||||||
and finally,
|
and finally,
|
||||||
.Ql * ,
|
.Ql * ,
|
||||||
.Ql ? ,
|
.Ql \&? ,
|
||||||
and
|
and
|
||||||
.Ql [
|
.Ql [
|
||||||
are used in file name generation (see
|
are used in file name generation (see
|
||||||
|
@ -373,7 +373,7 @@ last is piped (see
|
||||||
to the standard input of the following command.
|
to the standard input of the following command.
|
||||||
The exit status of a pipeline is that of its last command.
|
The exit status of a pipeline is that of its last command.
|
||||||
A pipeline may be prefixed by the
|
A pipeline may be prefixed by the
|
||||||
.Ql !
|
.Ql \&!
|
||||||
reversed word which causes the exit status of the pipeline to be logically
|
reversed word which causes the exit status of the pipeline to be logically
|
||||||
complemented: if the original status was 0 the complemented status will be 1;
|
complemented: if the original status was 0 the complemented status will be 1;
|
||||||
if the original status was not 0, the complemented status will be 0.
|
if the original status was not 0, the complemented status will be 0.
|
||||||
|
@ -1245,7 +1245,7 @@ command below for list of options).
|
||||||
.It Ev \&?
|
.It Ev \&?
|
||||||
The exit status of the last non-asynchronous command executed.
|
The exit status of the last non-asynchronous command executed.
|
||||||
If the last command was killed by a signal,
|
If the last command was killed by a signal,
|
||||||
.Ic \&$\&?
|
.Ic \&$?\&
|
||||||
is set to 128 plus the signal number.
|
is set to 128 plus the signal number.
|
||||||
.It Ev 0
|
.It Ev 0
|
||||||
The name the shell was invoked with (i.e.,
|
The name the shell was invoked with (i.e.,
|
||||||
|
@ -1446,7 +1446,7 @@ The default is 600 (10 minutes).
|
||||||
.It Ev MAILPATH
|
.It Ev MAILPATH
|
||||||
A list of files to be checked for mail.
|
A list of files to be checked for mail.
|
||||||
The list is colon separated, and each file may be followed by a
|
The list is colon separated, and each file may be followed by a
|
||||||
.Ql ?
|
.Ql \&?
|
||||||
and a message to be printed if new mail has arrived.
|
and a message to be printed if new mail has arrived.
|
||||||
Command, parameter and
|
Command, parameter and
|
||||||
arithmetic substitution is performed on the message, and, during substitution,
|
arithmetic substitution is performed on the message, and, during substitution,
|
||||||
|
@ -1491,12 +1491,12 @@ The process ID of the shell's parent (read-only).
|
||||||
The primary prompt for interactive shells.
|
The primary prompt for interactive shells.
|
||||||
Parameter, command, and arithmetic
|
Parameter, command, and arithmetic
|
||||||
substitutions are performed, and
|
substitutions are performed, and
|
||||||
.Ql !
|
.Ql \&!
|
||||||
is replaced with the current command number (see
|
is replaced with the current command number (see
|
||||||
.Ic fc
|
.Ic fc
|
||||||
command below).
|
command below).
|
||||||
A literal
|
A literal
|
||||||
.Ql !
|
.Ql \&!
|
||||||
can be put in the prompt by placing
|
can be put in the prompt by placing
|
||||||
.Ql !!
|
.Ql !!
|
||||||
in
|
in
|
||||||
|
@ -1663,7 +1663,7 @@ Brace expansion is carried out after parameter substitution
|
||||||
and before file name generation.
|
and before file name generation.
|
||||||
.Ss File name patterns
|
.Ss File name patterns
|
||||||
A file name pattern is a word containing one or more unquoted
|
A file name pattern is a word containing one or more unquoted
|
||||||
.Ql ?
|
.Ql \&?
|
||||||
or
|
or
|
||||||
.Ql *
|
.Ql *
|
||||||
characters or
|
characters or
|
||||||
|
@ -1696,7 +1696,7 @@ Similarly, a
|
||||||
must be quoted or the first character in the list if it is to represent itself
|
must be quoted or the first character in the list if it is to represent itself
|
||||||
instead of the end of the list.
|
instead of the end of the list.
|
||||||
Also, a
|
Also, a
|
||||||
.Ql !
|
.Ql \&!
|
||||||
appearing at the start of the list has special meaning (see below), so to
|
appearing at the start of the list has special meaning (see below), so to
|
||||||
represent itself it must be quoted or appear later in the list.
|
represent itself it must be quoted or appear later in the list.
|
||||||
.It Ic \&[\&! Ns No .. Ns Ic \&]
|
.It Ic \&[\&! Ns No .. Ns Ic \&]
|
||||||
|
@ -2421,7 +2421,7 @@ command substitutions performed in generating the
|
||||||
.Ic set
|
.Ic set
|
||||||
command.
|
command.
|
||||||
For example,
|
For example,
|
||||||
.Ic set \&-\&- `false`; echo $?
|
.Ic set \&-\&- `false`; echo $?\&
|
||||||
prints 0 in
|
prints 0 in
|
||||||
.Tn POSIX
|
.Tn POSIX
|
||||||
mode, 1 in
|
mode, 1 in
|
||||||
|
@ -2843,7 +2843,7 @@ The shell exits with the specified exit status.
|
||||||
If
|
If
|
||||||
.Ar status
|
.Ar status
|
||||||
is not specified, the exit status is the current value of the
|
is not specified, the exit status is the current value of the
|
||||||
.Ic \&?
|
.Ic ?\&
|
||||||
parameter.
|
parameter.
|
||||||
.It Xo Ic export Op Fl p
|
.It Xo Ic export Op Fl p
|
||||||
.Op Ar parameter Ns Op \&= Ns Ar value
|
.Op Ar parameter Ns Op \&= Ns Ar value
|
||||||
|
@ -3348,6 +3348,9 @@ Enable brace expansion (a.k.a., alternation).
|
||||||
.It Ic emacs
|
.It Ic emacs
|
||||||
Enable BRL emacs-like command-line editing (interactive shells only); see
|
Enable BRL emacs-like command-line editing (interactive shells only); see
|
||||||
.Sx Emacs editing mode .
|
.Sx Emacs editing mode .
|
||||||
|
.It Ic emacs-usemeta
|
||||||
|
In emacs command-line editing, use the 8th bit as meta (^[) prefix.
|
||||||
|
This is the default.
|
||||||
.It Ic gmacs
|
.It Ic gmacs
|
||||||
Enable gmacs-like command-line editing (interactive shells only).
|
Enable gmacs-like command-line editing (interactive shells only).
|
||||||
Currently identical to emacs editing except that transpose (^T) acts slightly
|
Currently identical to emacs editing except that transpose (^T) acts slightly
|
||||||
|
@ -3557,7 +3560,7 @@ is set (see
|
||||||
.Ic set
|
.Ic set
|
||||||
command above for a list of options).
|
command above for a list of options).
|
||||||
As a non-standard extension, if the option starts with a
|
As a non-standard extension, if the option starts with a
|
||||||
.Ql ! ,
|
.Ql \&! ,
|
||||||
the test is negated; the test always fails if
|
the test is negated; the test always fails if
|
||||||
.Ar option
|
.Ar option
|
||||||
doesn't exist (thus
|
doesn't exist (thus
|
||||||
|
@ -3671,15 +3674,15 @@ arguments to
|
||||||
or
|
or
|
||||||
.Ic \&[ ... \&]
|
.Ic \&[ ... \&]
|
||||||
is less than five; if leading
|
is less than five; if leading
|
||||||
.Ql !
|
.Ql \&!
|
||||||
arguments can be stripped such that only one argument remains then a string
|
arguments can be stripped such that only one argument remains then a string
|
||||||
length test is performed (again, even if the argument is a unary operator); if
|
length test is performed (again, even if the argument is a unary operator); if
|
||||||
leading
|
leading
|
||||||
.Ql !
|
.Ql \&!
|
||||||
arguments can be stripped such that three arguments remain and the second
|
arguments can be stripped such that three arguments remain and the second
|
||||||
argument is a binary operator, then the binary operation is performed (even
|
argument is a binary operator, then the binary operation is performed (even
|
||||||
if the first argument is a unary operator, including an unstripped
|
if the first argument is a unary operator, including an unstripped
|
||||||
.Ql ! ) .
|
.Ql \&! ) .
|
||||||
.Pp
|
.Pp
|
||||||
.Sy Note:
|
.Sy Note:
|
||||||
A common mistake is to use
|
A common mistake is to use
|
||||||
|
@ -4303,8 +4306,7 @@ When the
|
||||||
.Ic emacs
|
.Ic emacs
|
||||||
option is set, interactive input line editing is enabled.
|
option is set, interactive input line editing is enabled.
|
||||||
Warning: This mode is
|
Warning: This mode is
|
||||||
slightly different from the emacs mode in the original Korn shell and the 8th
|
slightly different from the emacs mode in the original Korn shell.
|
||||||
bit is stripped in emacs mode.
|
|
||||||
In this mode, various editing commands
|
In this mode, various editing commands
|
||||||
(typically bound to one or more control characters) cause immediate actions
|
(typically bound to one or more control characters) cause immediate actions
|
||||||
without waiting for a newline.
|
without waiting for a newline.
|
||||||
|
|
3
misc.c
3
misc.c
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: misc.c,v 1.18 2003/08/06 21:08:05 millert Exp $ */
|
/* $OpenBSD: misc.c,v 1.19 2003/09/01 15:47:40 naddy Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Miscellaneous functions
|
* Miscellaneous functions
|
||||||
|
@ -141,6 +141,7 @@ const struct option options[] = {
|
||||||
{ (char *) 0, 'c', OF_CMDLINE },
|
{ (char *) 0, 'c', OF_CMDLINE },
|
||||||
#ifdef EMACS
|
#ifdef EMACS
|
||||||
{ "emacs", 0, OF_ANY },
|
{ "emacs", 0, OF_ANY },
|
||||||
|
{ "emacs-usemeta", 0, OF_ANY }, /* non-standard */
|
||||||
#endif
|
#endif
|
||||||
{ "errexit", 'e', OF_ANY },
|
{ "errexit", 'e', OF_ANY },
|
||||||
#ifdef EMACS
|
#ifdef EMACS
|
||||||
|
|
26
sh.1tbl
26
sh.1tbl
|
@ -1,4 +1,4 @@
|
||||||
.\" $OpenBSD: sh.1tbl,v 1.34 2003/07/07 14:11:58 jmc Exp $
|
.\" $OpenBSD: sh.1tbl,v 1.36 2003/09/04 14:21:43 jmc Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1980, 1990, 1993
|
.\" Copyright (c) 1980, 1990, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
|
@ -275,7 +275,7 @@ shell and must be quoted if they are to represent themselves:
|
||||||
.Ql { ,
|
.Ql { ,
|
||||||
.Ql } ,
|
.Ql } ,
|
||||||
.Ql * ,
|
.Ql * ,
|
||||||
.Ql ? ,
|
.Ql \&? ,
|
||||||
and
|
and
|
||||||
.Ql [ .
|
.Ql [ .
|
||||||
The first three of these are the above mentioned quoting characters (see
|
The first three of these are the above mentioned quoting characters (see
|
||||||
|
@ -308,7 +308,7 @@ style alterations (see
|
||||||
below);
|
below);
|
||||||
and finally,
|
and finally,
|
||||||
.Ql * ,
|
.Ql * ,
|
||||||
.Ql ? ,
|
.Ql \&? ,
|
||||||
and
|
and
|
||||||
.Ql [
|
.Ql [
|
||||||
are used in file name generation (see
|
are used in file name generation (see
|
||||||
|
@ -364,7 +364,7 @@ last is piped (see
|
||||||
to the standard input of the following command.
|
to the standard input of the following command.
|
||||||
The exit status of a pipeline is that of its last command.
|
The exit status of a pipeline is that of its last command.
|
||||||
A pipeline may be prefixed by the
|
A pipeline may be prefixed by the
|
||||||
.Ql !
|
.Ql \&!
|
||||||
reversed word which causes the exit status of the pipeline to be logically
|
reversed word which causes the exit status of the pipeline to be logically
|
||||||
complemented: if the original status was 0 the complemented status will be 1;
|
complemented: if the original status was 0 the complemented status will be 1;
|
||||||
if the original status was not 0, the complemented status will be 0.
|
if the original status was not 0, the complemented status will be 0.
|
||||||
|
@ -1076,7 +1076,7 @@ command below for list of options).
|
||||||
.It Ev \&?
|
.It Ev \&?
|
||||||
The exit status of the last non-asynchronous command executed.
|
The exit status of the last non-asynchronous command executed.
|
||||||
If the last command was killed by a signal,
|
If the last command was killed by a signal,
|
||||||
.Ic \&$\&?
|
.Ic \&$?\&
|
||||||
is set to 128 plus the signal number.
|
is set to 128 plus the signal number.
|
||||||
.It Ev 0
|
.It Ev 0
|
||||||
The name the shell was invoked with (i.e.,
|
The name the shell was invoked with (i.e.,
|
||||||
|
@ -1324,7 +1324,7 @@ command may be used to list, change, and add to this cache (e.g.,
|
||||||
.Ic alias -d fac=/usr/local/facilities; cd ~fac/bin ) .
|
.Ic alias -d fac=/usr/local/facilities; cd ~fac/bin ) .
|
||||||
.Ss File name patterns
|
.Ss File name patterns
|
||||||
A file name pattern is a word containing one or more unquoted
|
A file name pattern is a word containing one or more unquoted
|
||||||
.Ql ?
|
.Ql \&?
|
||||||
or
|
or
|
||||||
.Ql *
|
.Ql *
|
||||||
characters or
|
characters or
|
||||||
|
@ -1357,7 +1357,7 @@ Similarly, a
|
||||||
must be quoted or the first character in the list if it is to represent itself
|
must be quoted or the first character in the list if it is to represent itself
|
||||||
instead of the end of the list.
|
instead of the end of the list.
|
||||||
Also, a
|
Also, a
|
||||||
.Ql !
|
.Ql \&!
|
||||||
appearing at the start of the list has special meaning (see below), so to
|
appearing at the start of the list has special meaning (see below), so to
|
||||||
represent itself it must be quoted or appear later in the list.
|
represent itself it must be quoted or appear later in the list.
|
||||||
.It Ic \&[\&! Ns No .. Ns Ic \&]
|
.It Ic \&[\&! Ns No .. Ns Ic \&]
|
||||||
|
@ -2017,7 +2017,7 @@ command substitutions performed in generating the
|
||||||
.Ic set
|
.Ic set
|
||||||
command.
|
command.
|
||||||
For example,
|
For example,
|
||||||
.Ic set \&-\&- `false`; echo $?
|
.Ic set \&-\&- `false`; echo $?\&
|
||||||
prints 0 in
|
prints 0 in
|
||||||
.Tn POSIX
|
.Tn POSIX
|
||||||
mode, 1 in
|
mode, 1 in
|
||||||
|
@ -2408,7 +2408,7 @@ The shell exits with the specified exit status.
|
||||||
If
|
If
|
||||||
.Ar status
|
.Ar status
|
||||||
is not specified, the exit status is the current value of the
|
is not specified, the exit status is the current value of the
|
||||||
.Ic \&?
|
.Ic ?\&
|
||||||
parameter.
|
parameter.
|
||||||
.It Xo Ic export Op Fl p
|
.It Xo Ic export Op Fl p
|
||||||
.Op Ar parameter Ns Op \&= Ns Ar value
|
.Op Ar parameter Ns Op \&= Ns Ar value
|
||||||
|
@ -3066,7 +3066,7 @@ is set (see
|
||||||
.Ic set
|
.Ic set
|
||||||
command above for a list of options).
|
command above for a list of options).
|
||||||
As a non-standard extension, if the option starts with a
|
As a non-standard extension, if the option starts with a
|
||||||
.Ql ! ,
|
.Ql \&! ,
|
||||||
the test is negated; the test always fails if
|
the test is negated; the test always fails if
|
||||||
.Ar option
|
.Ar option
|
||||||
doesn't exist (thus
|
doesn't exist (thus
|
||||||
|
@ -3168,15 +3168,15 @@ arguments to
|
||||||
or
|
or
|
||||||
.Ic \&[ ... \&]
|
.Ic \&[ ... \&]
|
||||||
is less than five; if leading
|
is less than five; if leading
|
||||||
.Ql !
|
.Ql \&!
|
||||||
arguments can be stripped such that only one argument remains then a string
|
arguments can be stripped such that only one argument remains then a string
|
||||||
length test is performed (again, even if the argument is a unary operator); if
|
length test is performed (again, even if the argument is a unary operator); if
|
||||||
leading
|
leading
|
||||||
.Ql !
|
.Ql \&!
|
||||||
arguments can be stripped such that three arguments remain and the second
|
arguments can be stripped such that three arguments remain and the second
|
||||||
argument is a binary operator, then the binary operation is performed (even
|
argument is a binary operator, then the binary operation is performed (even
|
||||||
if the first argument is a unary operator, including an unstripped
|
if the first argument is a unary operator, including an unstripped
|
||||||
.Ql ! ) .
|
.Ql \&! ) .
|
||||||
.Pp
|
.Pp
|
||||||
.Sy Note:
|
.Sy Note:
|
||||||
A common mistake is to use
|
A common mistake is to use
|
||||||
|
|
3
sh.h
3
sh.h
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: sh.h,v 1.13 2003/05/16 19:58:57 jsyn Exp $ */
|
/* $OpenBSD: sh.h,v 1.14 2003/09/01 15:47:40 naddy Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Public Domain Bourne/Korn shell
|
* Public Domain Bourne/Korn shell
|
||||||
|
@ -474,6 +474,7 @@ enum sh_flag {
|
||||||
FCOMMAND, /* -c: (invocation) execute specified command */
|
FCOMMAND, /* -c: (invocation) execute specified command */
|
||||||
#ifdef EMACS
|
#ifdef EMACS
|
||||||
FEMACS, /* emacs command editing */
|
FEMACS, /* emacs command editing */
|
||||||
|
FEMACSUSEMETA, /* use 8th bit as meta */
|
||||||
#endif
|
#endif
|
||||||
FERREXIT, /* -e: quit on error */
|
FERREXIT, /* -e: quit on error */
|
||||||
#ifdef EMACS
|
#ifdef EMACS
|
||||||
|
|
Loading…
Reference in New Issue