diff options
author | 2004-05-10 18:48:08 +0000 | |
---|---|---|
committer | 2004-05-10 18:48:08 +0000 | |
commit | 15b117eae8ea0caffec2fbd5cbd366a5ccee20ab (patch) | |
tree | a21b469ebd5946edc7efcaa9a4896fb726f16d36 /gnu/lib/libreadline/examples/manexamp.c | |
parent | Check return value of fclose() calls after writing. (diff) | |
download | wireguard-openbsd-15b117eae8ea0caffec2fbd5cbd366a5ccee20ab.tar.xz wireguard-openbsd-15b117eae8ea0caffec2fbd5cbd366a5ccee20ab.zip |
GNU readline 4.3p5
Diffstat (limited to 'gnu/lib/libreadline/examples/manexamp.c')
-rw-r--r-- | gnu/lib/libreadline/examples/manexamp.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/gnu/lib/libreadline/examples/manexamp.c b/gnu/lib/libreadline/examples/manexamp.c index 3496efa00e7..9c6cf2c76c6 100644 --- a/gnu/lib/libreadline/examples/manexamp.c +++ b/gnu/lib/libreadline/examples/manexamp.c @@ -1,12 +1,31 @@ /* manexamp.c -- The examples which appear in the documentation are here. */ +/* Copyright (C) 1987-2002 Free Software Foundation, Inc. + + This file is part of the GNU Readline Library, a library for + reading lines of text with interactive input and history editing. + + The GNU Readline Library 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 2, or + (at your option) any later version. + + The GNU Readline Library is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + The GNU General Public License is often shipped with GNU software, and + is generally kept in a file called COPYING or LICENSE. If you do not + have a copy of the license, write to the Free Software Foundation, + 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + #include <stdio.h> #include <readline/readline.h> - /* **************************************************************** */ /* */ -* How to Emulate gets () */ +/* How to Emulate gets () */ /* */ /* **************************************************************** */ @@ -82,13 +101,12 @@ invert_case_line (count, key) for (; start != end; start += direction) { - if (uppercase_p (rl_line_buffer[start])) - rl_line_buffer[start] = to_lower (rl_line_buffer[start]); - else if (lowercase_p (rl_line_buffer[start])) - rl_line_buffer[start] = to_upper (rl_line_buffer[start]); + if (_rl_uppercase_p (rl_line_buffer[start])) + rl_line_buffer[start] = _rl_to_lower (rl_line_buffer[start]); + else if (_rl_lowercase_p (rl_line_buffer[start])) + rl_line_buffer[start] = _rl_to_upper (rl_line_buffer[start]); } /* Move point to on top of the last character changed. */ rl_point = end - direction; } - |