Sophie

Sophie

distrib > Altlinux > 4.1 > i586 > media > core-src > by-pkgid > 4ab8ee97b2f86f0de7ab33ede3d384ea > files > 4

readline4.3-4.3-alt8.src.rpm

diff -uprk.orig readline-4.3.orig/bind.c readline-4.3/bind.c
--- readline-4.3.orig/bind.c	2002-12-14 20:26:09 +0300
+++ readline-4.3/bind.c	2002-12-14 20:26:39 +0300
@@ -348,7 +348,7 @@ rl_translate_keyseq (seq, array, len)
 {
   register int i, c, l, temp;
 
-  for (i = l = 0; c = seq[i]; i++)
+  for (i = l = 0; (c = seq[i]); i++)
     {
       if (c == '\\')
 	{
@@ -1050,7 +1050,7 @@ rl_parse_and_bind (string)
     {
       int passc = 0;
 
-      for (i = 1; c = string[i]; i++)
+      for (i = 1; (c = string[i]); i++)
 	{
 	  if (passc)
 	    {
@@ -1126,7 +1126,7 @@ rl_parse_and_bind (string)
     {
       int delimiter = string[i++], passc;
 
-      for (passc = 0; c = string[i]; i++)
+      for (passc = 0; (c = string[i]); i++)
 	{
 	  if (passc)
 	    {
@@ -1873,7 +1873,7 @@ rl_function_dumper (print_readably)
 
   fprintf (rl_outstream, "\n");
 
-  for (i = 0; name = names[i]; i++)
+  for (i = 0; (name = names[i]); i++)
     {
       rl_command_func_t *function;
       char **invokers;
diff -uprk.orig readline-4.3.orig/complete.c readline-4.3/complete.c
--- readline-4.3.orig/complete.c	2002-05-07 23:39:32 +0400
+++ readline-4.3/complete.c	2002-12-14 20:26:39 +0300
@@ -714,7 +714,7 @@ _rl_find_completion_word (fp, dp)
          completion, so use the word break characters to find the
          substring on which to complete. */
 #if defined (HANDLE_MULTIBYTE)
-      while (rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_ANY))
+      while ((rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_ANY)))
 #else
       while (--rl_point)
 #endif
@@ -1612,7 +1612,7 @@ rl_completion_matches (text, entry_funct
   match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
   match_list[1] = (char *)NULL;
 
-  while (string = (*entry_function) (text, matches))
+  while ((string = (*entry_function) (text, matches)))
     {
       if (matches + 1 == match_list_size)
 	match_list = (char **)xrealloc
@@ -1662,7 +1662,7 @@ rl_username_completion_function (text, s
       setpwent ();
     }
 
-  while (entry = getpwent ())
+  while ((entry = getpwent ()))
     {
       /* Null usernames should result in all users as possible completions. */
       if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
diff -uprk.orig readline-4.3.orig/display.c readline-4.3/display.c
--- readline-4.3.orig/display.c	2002-12-14 20:26:09 +0300
+++ readline-4.3/display.c	2002-12-14 20:26:39 +0300
@@ -70,6 +70,9 @@ static void insert_some_chars PARAMS((ch
 static void cr PARAMS((void));
 
 #if defined (HANDLE_MULTIBYTE)
+#ifdef HAVE_WCHAR_H
+#  include <wchar.h>
+#endif /* HAVE_WCHAR_H */
 static int _rl_col_width PARAMS((const char *, int, int));
 static int *_rl_wrapped_line;
 #else
@@ -386,7 +389,7 @@ rl_redisplay ()
 #if defined (HANDLE_MULTIBYTE)
   wchar_t wc;
   size_t wc_bytes;
-  int wc_width;
+  int wc_width = 0;
   mbstate_t ps;
   int _rl_wrapped_multicolumn = 0;
 #endif
@@ -1041,7 +1044,7 @@ update_line (old, new, current_line, oma
   int col_lendiff, col_temp;
 #if defined (HANDLE_MULTIBYTE)
   mbstate_t ps_new, ps_old;
-  int new_offset, old_offset, tmp;
+  int new_offset, old_offset;
 #endif
 
   /* If we're at the right edge of a terminal that supports xn, we're
diff -uprk.orig readline-4.3.orig/examples/fileman.c readline-4.3/examples/fileman.c
--- readline-4.3.orig/examples/fileman.c	2002-04-17 00:50:55 +0400
+++ readline-4.3/examples/fileman.c	2002-12-14 20:26:39 +0300
@@ -50,6 +50,8 @@
 #  include <stdlib.h>
 #endif
 
+#include <time.h>
+
 #ifdef READLINE_LIBRARY
 #  include "readline.h"
 #  include "history.h"
@@ -70,6 +72,10 @@ int com_delete PARAMS((char *));
 int com_help PARAMS((char *));
 int com_cd PARAMS((char *));
 int com_quit PARAMS((char *));
+void initialize_readline PARAMS((void));
+int execute_line PARAMS((char *line));
+int valid_argument PARAMS((char *caller, char *arg));
+void too_dangerous PARAMS((char *caller));
 
 /* A structure which contains information on the commands this program
    can understand. */
@@ -116,6 +122,7 @@ dupstr (s)
   return (r);
 }
 
+int
 main (argc, argv)
      int argc;
      char **argv;
@@ -238,6 +245,7 @@ char **fileman_completion PARAMS((const 
 /* Tell the GNU Readline library how to complete.  We want to try to complete
    on command names if this is the first word in the line, or on filenames
    if not. */
+void
 initialize_readline ()
 {
   /* Allow conditional parsing of the ~/.inputrc file. */
@@ -291,7 +299,7 @@ command_generator (text, state)
     }
 
   /* Return the next name which partially matches from the command list. */
-  while (name = commands[list_index].name)
+  while ((name = commands[list_index].name))
     {
       list_index++;
 
@@ -314,6 +322,7 @@ command_generator (text, state)
 static char syscom[1024];
 
 /* List the file(s) named in arg. */
+int
 com_list (arg)
      char *arg;
 {
@@ -324,6 +333,7 @@ com_list (arg)
   return (system (syscom));
 }
 
+int
 com_view (arg)
      char *arg;
 {
@@ -339,6 +349,7 @@ com_view (arg)
   return (system (syscom));
 }
 
+int
 com_rename (arg)
      char *arg;
 {
@@ -346,6 +357,7 @@ com_rename (arg)
   return (1);
 }
 
+int
 com_stat (arg)
      char *arg;
 {
@@ -374,6 +386,7 @@ com_stat (arg)
   return (0);
 }
 
+int
 com_delete (arg)
      char *arg;
 {
@@ -383,6 +396,7 @@ com_delete (arg)
 
 /* Print out help for ARG, or for all of the commands if ARG is
    not present. */
+int
 com_help (arg)
      char *arg;
 {
@@ -422,6 +436,7 @@ com_help (arg)
 }
 
 /* Change to the directory ARG. */
+int
 com_cd (arg)
      char *arg;
 {
@@ -436,6 +451,7 @@ com_cd (arg)
 }
 
 /* Print out the current working directory. */
+int
 com_pwd (ignore)
      char *ignore;
 {
@@ -453,6 +469,7 @@ com_pwd (ignore)
 }
 
 /* The user wishes to quit using this program.  Just set DONE non-zero. */
+int
 com_quit (arg)
      char *arg;
 {
@@ -461,6 +478,7 @@ com_quit (arg)
 }
 
 /* Function which tells you that you can't do this. */
+void
 too_dangerous (caller)
      char *caller;
 {
diff -uprk.orig readline-4.3.orig/examples/histexamp.c readline-4.3/examples/histexamp.c
--- readline-4.3.orig/examples/histexamp.c	2002-04-17 00:52:36 +0400
+++ readline-4.3/examples/histexamp.c	2002-12-14 20:26:39 +0300
@@ -19,6 +19,8 @@
    59 Temple Place, Suite 330, Boston, MA 02111 USA. */
 
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #ifdef READLINE_LIBRARY
 #  include "history.h"
@@ -26,6 +28,7 @@
 #  include <readline/history.h>
 #endif
 
+int
 main (argc, argv)
      int argc;
      char **argv;
@@ -109,4 +112,5 @@ main (argc, argv)
             }
         }
     }
+    return EXIT_SUCCESS;
 }
diff -uprk.orig readline-4.3.orig/examples/rl.c readline-4.3/examples/rl.c
--- readline-4.3.orig/examples/rl.c	2002-04-17 00:53:16 +0400
+++ readline-4.3/examples/rl.c	2002-12-14 20:26:39 +0300
@@ -29,6 +29,14 @@
 #  include <config.h>
 #endif
 
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
+
+#if defined (HAVE_STDLIB_H)
+#  include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
+
 #include <stdio.h>
 #include <sys/types.h>
 #include "posixstat.h"
diff -uprk.orig readline-4.3.orig/examples/rlcat.c readline-4.3/examples/rlcat.c
--- readline-4.3.orig/examples/rlcat.c	2002-04-17 00:53:30 +0400
+++ readline-4.3/examples/rlcat.c	2002-12-14 20:26:39 +0300
@@ -28,6 +28,10 @@
 #  include <config.h>
 #endif
 
+#if defined (HAVE_STDLIB_H)
+#  include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
+
 #ifdef HAVE_UNISTD_H
 #  include <unistd.h>
 #endif
@@ -110,7 +114,7 @@ main (argc, argv)
     return stdcat(argc, argv);
 
   rl_variable_bind ("editing-mode", Vflag ? "vi" : "emacs");
-  while (temp = readline (""))
+  while ((temp = readline ("")))
     {
       if (*temp)
         add_history (temp);
@@ -146,8 +150,7 @@ stdcat (argc, argv)
      int argc;
      char **argv;
 {
-  int  i, fd, r;
-  char *s;
+  int  i, r;
   FILE *fp;
 
   if (argc == 0)
diff -uprk.orig readline-4.3.orig/examples/rltest.c readline-4.3/examples/rltest.c
--- readline-4.3.orig/examples/rltest.c	2002-04-17 00:53:52 +0400
+++ readline-4.3/examples/rltest.c	2002-12-14 20:26:39 +0300
@@ -28,6 +28,10 @@
 #include <config.h>
 #endif
 
+#if defined (HAVE_STDLIB_H)
+#  include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
+
 #include <stdio.h>
 #include <sys/types.h>
 
@@ -41,6 +45,7 @@
 
 extern HIST_ENTRY **history_list ();
 
+int
 main ()
 {
   char *temp, *prompt;
diff -uprk.orig readline-4.3.orig/examples/rlversion.c readline-4.3/examples/rlversion.c
--- readline-4.3.orig/examples/rlversion.c	2002-04-17 00:55:29 +0400
+++ readline-4.3/examples/rlversion.c	2002-12-14 20:26:39 +0300
@@ -26,6 +26,10 @@
 #  include <config.h>
 #endif
 
+#if defined (HAVE_STDLIB_H)
+#  include <stdlib.h>
+#endif /* HAVE_STDLIB_H */
+
 #include <stdio.h>
 #include <sys/types.h>
 #include "posixstat.h"
@@ -36,6 +40,7 @@
 #  include <readline/readline.h>
 #endif
 
+int
 main()
 {
 	printf ("%s\n", rl_library_version ? rl_library_version : "unknown");
diff -uprk.orig readline-4.3.orig/histexpand.c readline-4.3/histexpand.c
--- readline-4.3.orig/histexpand.c	2002-04-16 19:47:59 +0400
+++ readline-4.3/histexpand.c	2002-12-14 20:26:39 +0300
@@ -201,7 +201,7 @@ get_history_event (string, caller_index,
     }
 
   /* Only a closing `?' or a newline delimit a substring search string. */
-  for (local_index = i; c = string[i]; i++)
+  for (local_index = i; (c = string[i]); i++)
 #if defined (HANDLE_MULTIBYTE)
     if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
       {
diff -uprk.orig readline-4.3.orig/histfile.c readline-4.3/histfile.c
--- readline-4.3.orig/histfile.c	2002-03-26 17:00:26 +0300
+++ readline-4.3/histfile.c	2002-12-14 20:26:39 +0300
@@ -374,7 +374,9 @@ history_do_write (filename, nelements, o
   register int i;
   char *output;
   int file, mode, rv;
+#ifdef HAVE_MMAP
   size_t cursize;
+#endif
 
 #ifdef HAVE_MMAP
   mode = overwrite ? O_RDWR|O_CREAT|O_TRUNC|O_BINARY : O_RDWR|O_APPEND|O_BINARY;
diff -uprk.orig readline-4.3.orig/input.c readline-4.3/input.c
--- readline-4.3.orig/input.c	2002-02-21 17:50:45 +0300
+++ readline-4.3/input.c	2002-12-14 20:26:39 +0300
@@ -387,7 +387,7 @@ rl_read_key ()
   else
     {
       /* If input is coming from a macro, then use that. */
-      if (c = _rl_next_macro_key ())
+      if ((c = _rl_next_macro_key ()))
 	return (c);
 
       /* If the user has an event function, then call it periodically. */
diff -uprk.orig readline-4.3.orig/mbutil.c readline-4.3/mbutil.c
--- readline-4.3.orig/mbutil.c	2002-06-04 19:54:29 +0400
+++ readline-4.3/mbutil.c	2002-12-14 20:29:51 +0300
@@ -72,6 +72,10 @@ int rl_byte_oriented = 1;
 
 #if defined(HANDLE_MULTIBYTE)
 
+#ifdef HAVE_WCHAR_H
+#  include <wchar.h>
+#endif /* HAVE_WCHAR_H */
+
 static int
 _rl_find_next_mbchar_internal (string, seed, count, find_non_zero)
      char *string;
@@ -196,12 +200,12 @@ _rl_find_prev_mbchar_internal (string, s
    if it couldn't parse a complete  multibyte character.  */
 int
 _rl_get_char_len (src, ps)
-     char *src;
+     const char *src;
      mbstate_t *ps;
 {
   size_t tmp;
 
-  tmp = mbrlen((const char *)src, (size_t)strlen (src), ps);
+  tmp = mbrlen(src, (size_t)strlen (src), ps);
   if (tmp == (size_t)(-2))
     {
       /* shorted to compose multibyte char */
@@ -251,7 +255,7 @@ _rl_compare_chars (buf1, pos1, ps1, buf2
    it returns -1 */
 int
 _rl_adjust_point(string, point, ps)
-     char *string;
+     const char *string;
      int point;
      mbstate_t *ps;
 {
diff -uprk.orig readline-4.3.orig/rlmbutil.h readline-4.3/rlmbutil.h
--- readline-4.3.orig/rlmbutil.h	2001-12-20 17:54:38 +0300
+++ readline-4.3/rlmbutil.h	2002-12-14 20:28:58 +0300
@@ -82,8 +82,8 @@ extern int _rl_find_next_mbchar PARAMS((
 #ifdef HANDLE_MULTIBYTE
 
 extern int _rl_compare_chars PARAMS((char *, int, mbstate_t *, char *, int, mbstate_t *));
-extern int _rl_get_char_len PARAMS((char *, mbstate_t *));
-extern int _rl_adjust_point PARAMS((char *, int, mbstate_t *));
+extern int _rl_get_char_len PARAMS((const char *, mbstate_t *));
+extern int _rl_adjust_point PARAMS((const char *, int, mbstate_t *));
 
 extern int _rl_read_mbchar PARAMS((char *, int));
 extern int _rl_read_mbstring PARAMS((int, char *, int));
diff -uprk.orig readline-4.3.orig/tilde.c readline-4.3/tilde.c
--- readline-4.3.orig/tilde.c	2002-03-12 19:29:36 +0300
+++ readline-4.3/tilde.c	2002-12-14 20:26:39 +0300
@@ -190,7 +190,7 @@ tilde_expand (string)
   int result_size, result_index;
 
   result_index = result_size = 0;
-  if (result = strchr (string, '~'))
+  if ((result = strchr (string, '~')))
     result = (char *)xmalloc (result_size = (strlen (string) + 16));
   else
     result = (char *)xmalloc (result_size = (strlen (string) + 1));