]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Print function definitions (sort of).
authorTed Lemon <source@isc.org>
Tue, 15 Feb 2000 19:41:32 +0000 (19:41 +0000)
committerTed Lemon <source@isc.org>
Tue, 15 Feb 2000 19:41:32 +0000 (19:41 +0000)
common/print.c

index a6994e202a713671698c4a902603443d6125e502..87f9dec1c83e0e77188159d9bd1fa750ff0a9f79 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: print.c,v 1.39 2000/02/05 18:05:45 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: print.c,v 1.40 2000/02/15 19:41:32 mellon Exp $ Copyright (c) 1995, 1996, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -773,10 +773,28 @@ static unsigned print_subexpression (expr, buf, len)
                        buf [rv++] = ' ';
                        rv += print_subexpression (expr -> data.arg.next,
                                                   buf, len);
+                       if (rv + 1 < len)
+                               buf [rv++] = 0;
+                       return rv;
                }
-               if (rv + 1 < len)
-                       buf [rv++] = 0;
                break;
+             case expr_function:
+               rv = 9;
+               if (len > rv + 1) {
+                       struct string_list *foo;
+                       strcpy (buf, "(function");
+                       for (foo = expr -> data.func -> args;
+                            foo; foo = foo -> next) {
+                               if (len > rv + 2 + strlen (foo -> string)) {
+                                       buf [rv - 1] = ' ';
+                                       strcpy (&buf [rv], foo -> string);
+                                       rv += strlen (foo -> string);
+                               }
+                       }
+                       buf [rv] = ')';
+                       buf [rv++] = 0;
+                       return rv;
+               }
        }
        return 0;
 }