INN commit: trunk/tests/lib (innconf-t.c)

INN Commit rra at isc.org
Sun Jan 30 15:23:59 UTC 2011


    Date: Sunday, January 30, 2011 @ 07:23:59
  Author: iulius
Revision: 9177

Use cat, grep -v and echo instead of sed.  The sed syntax is too
different depending on the platform.

Modified:
  trunk/tests/lib/innconf-t.c

-------------+
 innconf-t.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Modified: innconf-t.c
===================================================================
--- innconf-t.c	2011-01-30 15:21:22 UTC (rev 9176)
+++ innconf-t.c	2011-01-30 15:23:59 UTC (rev 9177)
@@ -14,9 +14,10 @@
  ../../samples/inn.conf; echo 'domain: \"news.example.org\"';\
  echo 'fromhost: \"news.example.org\"';) > config/tmp";
 
-static const char sed[] =
-"sed 's/^#\\(domain\\|fromhost\\):/\\1: \"news.example.org\"/'\
- ../../samples/inn.conf > config/tmp2";
+static const char cat[] =
+"(cat ../../samples/inn.conf | egrep -v '^#(domain|fromhost)';\
+ echo 'domain: \"news.example.org\"'; echo 'fromhost: \"news.example.org\"';)\
+ > config/tmp2";
 
 int
 main(void)
@@ -33,7 +34,7 @@
 
     test_init(9);
 
-    if (system(sed) != 0)
+    if (system(cat) != 0)
         die("Unable to create stripped configuration file");
     ok(1, innconf_read("config/tmp2"));
     standard = innconf;




More information about the inn-committers mailing list