From 40e51c1276727d1d649e318257d5cdab2a3e96be Mon Sep 17 00:00:00 2001 From: ellson Date: Wed, 15 Jul 2009 14:46:14 +0000 Subject: [PATCH] further simplification - don't even bother with feof() - its useless --- tclpkg/gv/demo/modgraph.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tclpkg/gv/demo/modgraph.php b/tclpkg/gv/demo/modgraph.php index 12e8bcded..fec2a8fbf 100755 --- a/tclpkg/gv/demo/modgraph.php +++ b/tclpkg/gv/demo/modgraph.php @@ -20,11 +20,7 @@ gv::setv($N, "fontsize", "8"); gv::setv($N, "fontname", "helvetica"); gv::setv($E, "arrowsize", ".4"); -$f = fopen("/proc/modules", "r"); -while ( ! feof($f)) { - $rec = fgets($f); - if ($rec == "") break; - +if ($f = fopen("/proc/modules", "r")) while ($rec = fgets($f)) { $matches = preg_split("/[\s]+/", $rec, -1, PREG_SPLIT_NO_EMPTY); $n = gv::node($G,$matches[0]); $usedbylist = preg_split("/[,]/", $matches[3], -1, PREG_SPLIT_NO_EMPTY); -- 2.40.0