diff src/xxd/xxd.c @ 15627:11879b89bb69 v8.1.0821

patch 8.1.0821: xxd "usage" output and other arguments not tested commit https://github.com/vim/vim/commit/970f5d39f27717b1a529b7b250a8ed7c3f791949 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jan 25 21:52:17 2019 +0100 patch 8.1.0821: xxd "usage" output and other arguments not tested Problem: Xxd "usage" output and other arguments not tested. Solution: Add a test to trigger the usage output in various ways. Fix uncovered problem.
author Bram Moolenaar <Bram@vim.org>
date Fri, 25 Jan 2019 22:00:15 +0100
parents 362b27e3f702
children e00983850550
line wrap: on
line diff
--- a/src/xxd/xxd.c
+++ b/src/xxd/xxd.c
@@ -508,10 +508,10 @@ main(int argc, char *argv[])
 	}
       else if (!STRNCMP(pp, "-c", 2))
 	{
-	  if (pp[2] && STRNCMP("ols", pp + 2, 3))
+	  if (pp[2] && !STRNCMP("apitalize", pp + 2, 9))
+	    capitalize = 1;
+	  else if (pp[2] && STRNCMP("ols", pp + 2, 3))
 	    cols = (int)strtol(pp + 2, NULL, 0);
-	  else if (pp[2] && STRNCMP("apitalize", pp + 2, 9))
-	    capitalize = 1;
 	  else
 	    {
 	      if (!argv[2])
@@ -523,7 +523,7 @@ main(int argc, char *argv[])
 	}
       else if (!STRNCMP(pp, "-g", 2))
 	{
-	  if (pp[2] && STRNCMP("group", pp + 2, 5))
+	  if (pp[2] && STRNCMP("roup", pp + 2, 4))
 	    octspergrp = (int)strtol(pp + 2, NULL, 0);
 	  else
 	    {