GNU bug report logs - #2878
bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23

Previous Next

Package: emacs;

Reported by: Yee Keat Phuah <ykphuah <at> gmail.com>

Date: Fri, 3 Apr 2009 15:25:05 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 2878 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Miles Bader  <miles <at> gnu.org>
Cc: Yee Keat Phuah <ykphuah <at> gmail.com>, 2878 <at> debbugs.gnu.org
Subject: Re: bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23)
Date: Sun, 03 May 2009 10:49:09 -0400
Miles, could I verify that this patch is correct, and should be checked
in?

> snogglethorpe from #emacs have suggested this patch and it worked for
> my elisp code

> --- a/lisp/emacs-lisp/bindat.el
> +++ b/lisp/emacs-lisp/bindat.el
> @@ -609,9 +609,9 @@ Optional fourth arg BINDAT-IDX is the starting
> offset into BINDAT-RAW."
>    (let ((no-return bindat-raw))
>      (unless bindat-idx (setq bindat-idx 0))
>      (unless bindat-raw
> -      (setq bindat-raw (make-vector (+ bindat-idx (bindat-length spec struct)) 0)))
> +      (setq bindat-raw (make-string (+ bindat-idx (bindat-length spec struct)) 0)))
>      (bindat--pack-group struct spec)
> -    (if no-return nil (concat bindat-raw))))
> +    (if no-return nil bindat-raw)))




This bug report was last modified 16 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.