Author: jh
Date: Fri Oct  7 14:27:20 2011
New Revision: 226106
URL: http://svn.freebsd.org/changeset/base/226106

Log:
  MFC r218410: Handle EOF when skipping lines.

Modified:
  stable/7/usr.bin/rs/rs.c
Directory Properties:
  stable/7/usr.bin/rs/   (props changed)

Modified: stable/7/usr.bin/rs/rs.c
==============================================================================
--- stable/7/usr.bin/rs/rs.c    Fri Oct  7 13:43:01 2011        (r226105)
+++ stable/7/usr.bin/rs/rs.c    Fri Oct  7 14:27:20 2011        (r226106)
@@ -130,14 +130,17 @@ getfile(void)
        char *p;
        char *endp;
        char **ep;
+       int c;
        int multisep = (flags & ONEISEPONLY ? 0 : 1);
        int nullpad = flags & NULLPAD;
        char **padto;
 
        while (skip--) {
-               getline();
+               c = getline();
                if (flags & SKIPPRINT)
                        puts(curline);
+               if (c == EOF)
+                       return;
        }
        getline();
        if (flags & NOARGS && curlen < owidth)
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to