Subject: Re: bug#2878: Acknowledgement (bindat-pack returns unibyte string for emacs 22 but multibyte string for emacs 23)

From: Chong Yidong <[email-masked]>
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)))