changeset 976:f84dd3473233

Fix lspci -e
author Felix Janda <felix.janda@posteo.de>
date Sat, 27 Jul 2013 09:45:40 +0200
parents afcc28799172
children 9a96527bea94
files toys/pending/lspci.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/toys/pending/lspci.c	Fri Jul 26 18:23:08 2013 -0500
+++ b/toys/pending/lspci.c	Sat Jul 27 09:45:40 2013 +0200
@@ -36,7 +36,7 @@
       int fd, size;
 
       if ((fd = openat(dirfd, *fields, O_RDONLY)) < 0) continue;
-      size = 6 + 2*((toys.optflags & FLAG_e) && (p != toybuf));
+      size = ((toys.optflags & FLAG_e) && (p == toybuf)) ? 8 : 6;
       p[read(fd, p, size)] = '\0';
       close(fd);
     }