ab65c6c
To: vim-dev@vim.org
ab65c6c
Subject: Patch 7.2.367
ab65c6c
Fcc: outbox
ab65c6c
From: Bram Moolenaar <Bram@moolenaar.net>
ab65c6c
Mime-Version: 1.0
ab65c6c
Content-Type: text/plain; charset=UTF-8
ab65c6c
Content-Transfer-Encoding: 8bit
ab65c6c
------------
ab65c6c
ab65c6c
Patch 7.2.367
ab65c6c
Problem:    "xxd -r -p" doesn't work as documented.
ab65c6c
Solution:   Skip white space. (James Vega)
ab65c6c
Files:	    src/xxd/xxd.c
ab65c6c
ab65c6c
ab65c6c
*** ../vim-7.2.366/src/xxd/xxd.c	2009-06-16 18:29:37.000000000 +0200
ab65c6c
--- src/xxd/xxd.c	2010-02-17 18:25:11.000000000 +0100
ab65c6c
***************
ab65c6c
*** 231,237 ****
ab65c6c
    fprintf(stderr, "    or\n       %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname);
ab65c6c
    fprintf(stderr, "Options:\n");
ab65c6c
    fprintf(stderr, "    -a          toggle autoskip: A single '*' replaces nul-lines. Default off.\n");
ab65c6c
!   fprintf(stderr, "    -b          binary digit dump (incompatible with -p,-i,-r). Default hex.\n");
ab65c6c
    fprintf(stderr, "    -c cols     format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n");
ab65c6c
    fprintf(stderr, "    -E          show characters in EBCDIC. Default ASCII.\n");
ab65c6c
    fprintf(stderr, "    -g          number of octets per group in normal output. Default 2.\n");
ab65c6c
--- 231,237 ----
ab65c6c
    fprintf(stderr, "    or\n       %s -r [-s [-]offset] [-c cols] [-ps] [infile [outfile]]\n", pname);
ab65c6c
    fprintf(stderr, "Options:\n");
ab65c6c
    fprintf(stderr, "    -a          toggle autoskip: A single '*' replaces nul-lines. Default off.\n");
ab65c6c
!   fprintf(stderr, "    -b          binary digit dump (incompatible with -ps,-i,-r). Default hex.\n");
ab65c6c
    fprintf(stderr, "    -c cols     format <cols> octets per line. Default 16 (-i: 12, -ps: 30).\n");
ab65c6c
    fprintf(stderr, "    -E          show characters in EBCDIC. Default ASCII.\n");
ab65c6c
    fprintf(stderr, "    -g          number of octets per group in normal output. Default 2.\n");
ab65c6c
***************
ab65c6c
*** 276,286 ****
ab65c6c
        if (c == '\r')	/* Doze style input file? */
ab65c6c
  	continue;
ab65c6c
  
ab65c6c
! #if 0	/* this doesn't work when there is normal text after the hex codes in
ab65c6c
! 	   the last line that looks like hex */
ab65c6c
!       if (c == ' ' || c == '\n' || c == '\t')  /* allow multiple spaces */
ab65c6c
  	continue;
ab65c6c
- #endif
ab65c6c
  
ab65c6c
        n3 = n2;
ab65c6c
        n2 = n1;
ab65c6c
--- 276,286 ----
ab65c6c
        if (c == '\r')	/* Doze style input file? */
ab65c6c
  	continue;
ab65c6c
  
ab65c6c
!       /* Allow multiple spaces.  This doesn't work when there is normal text
ab65c6c
!        * after the hex codes in the last line that looks like hex, thus only
ab65c6c
!        * use it for PostScript format. */
ab65c6c
!       if (hextype == HEX_POSTSCRIPT && (c == ' ' || c == '\n' || c == '\t'))
ab65c6c
  	continue;
ab65c6c
  
ab65c6c
        n3 = n2;
ab65c6c
        n2 = n1;
ab65c6c
*** ../vim-7.2.366/src/version.c	2010-02-17 18:20:23.000000000 +0100
ab65c6c
--- src/version.c	2010-02-17 18:26:35.000000000 +0100
ab65c6c
***************
ab65c6c
*** 683,684 ****
ab65c6c
--- 683,686 ----
ab65c6c
  {   /* Add new patch number below this line */
ab65c6c
+ /**/
ab65c6c
+     367,
ab65c6c
  /**/
ab65c6c
ab65c6c
-- 
ab65c6c
hundred-and-one symptoms of being an internet addict:
ab65c6c
248. You sign your letters with your e-mail address instead of your name.
ab65c6c
ab65c6c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
ab65c6c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
ab65c6c
\\\        download, build and distribute -- http://www.A-A-P.org        ///
ab65c6c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///