Hi,
In revision 1.35 of file.c tenex() was modified to respect the
inputline_size argument. I did miss one conditional which depends on the
size of the input buffer. This change does not cause any functional
change since tenex() only has one call site where
`inputline_size == sizeof(buf)` but for correctness...

While here, zap a redundant cast. Will go in a separate commit.

Comments? OK?

Index: file.c
===================================================================
RCS file: /cvs/src/bin/csh/file.c,v
retrieving revision 1.35
diff -u -p -r1.35 file.c
--- file.c      30 Aug 2017 06:57:48 -0000      1.35
+++ file.c      15 Nov 2017 07:47:01 -0000
@@ -673,8 +673,7 @@ again:                              /* search for matches */
        return (numitems);
     }
     else {                     /* LIST */
-       qsort(items, numitems, sizeof(*items),
-               (int (*)(const void *, const void *)) sortscmp);
+       qsort(items, numitems, sizeof(*items), sortscmp);
        print_by_column(looking_for_lognames ? NULL : tilded_dir,
                        items, numitems);
        if (items != NULL)
@@ -810,7 +809,7 @@ tenex(Char *inputline, int inputline_siz
         * buffer is full since more characters must be read in order to form a
         * complete command.
         */
-       if (i < sizeof(buf))
+       if (i < cl.size)
                inputline[i] = '\0';
 
        return cl.len;

Reply via email to