]> git.proxmox.com Git - mirror_frr.git/blobdiff - python/clidef.py
Merge pull request #3655 from rubenk/macos-fixes
[mirror_frr.git] / python / clidef.py
index 2e5590964715b3db3c24b8211a9d1462db96c624..f8d96115bde887460887e01759129fe36c404f73 100644 (file)
@@ -41,7 +41,7 @@ class RenderHandler(object):
 class StringHandler(RenderHandler):
     argtype = 'const char *'
     decl = Template('const char *$varname = NULL;')
-    code = Template('$varname = argv[_i]->arg;')
+    code = Template('$varname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;')
     drop_str = True
     canfail = False
 
@@ -96,7 +96,7 @@ class IP4Handler(IPBase):
     code = Template('_fail = !inet_aton(argv[_i]->arg, &$varname);')
 class IP6Handler(IPBase):
     argtype = 'struct in6_addr'
-    decl = Template('struct in6_addr $varname = IN6ADDR_ANY_INIT;')
+    decl = Template('struct in6_addr $varname = {};')
     code = Template('_fail = !inet_pton(AF_INET6, argv[_i]->arg, &$varname);')
 class IPGenHandler(IPBase):
     argtype = 'const union sockunion *'
@@ -277,4 +277,4 @@ if __name__ == '__main__':
     process_file(args.cfile, ofd, dumpfd, args.all_defun)
 
     if args.o is not None:
-        clippy.wrdiff(args.o, ofd, [args.cfile, os.path.realpath(__file__)])
+        clippy.wrdiff(args.o, ofd, [args.cfile, os.path.realpath(__file__), sys.executable])