unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16686: 23.1; hexl-insert-hex-char shortens file by 7 bytes
@ 2014-02-08  1:42 Jacob Burckhardt
  2014-02-08  9:04 ` Eli Zaretskii
  2014-02-08  9:24 ` Andreas Schwab
  0 siblings, 2 replies; 4+ messages in thread
From: Jacob Burckhardt @ 2014-02-08  1:42 UTC (permalink / raw)
  To: 16686

hexl-insert-hex-char is supposed to change a character meaning the file
size should remain the same.  But it actually deletes 7 bytes from the
file.  Here is how to reproduce it:

* In the shell, I ran: env printf
'\xee\x00\x4a\x7b\x30\x90\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00\x00' >! /tmp/testfile

* In the shell, I ran "env ls -l /tmp/testfile".  It output:

-rw-r--r-- 1 jburckhardt jburckhardt 23 Feb  7 17:27 /tmp/testfile

* emacs -q /tmp/testfile &

* M-x hexl-mode <return>

* M-x hexl-insert-hex-char <return>

* ff <return>

* C-x C-s

* Type 'y' to acknowledge the warning about loss of undo info.

* In the shell, I ran "env ls -l /tmp/testfile".  It output:

-rw-r--r-- 1 jburckhardt jburckhardt 16 Feb  7 17:29 /tmp/testfile

Notice that the first ls command said 23 bytes, but the last ls command
said 16 bytes.  So it lost 7 bytes.  The second ls command should have
also said 23 bytes.

This happened on GNU Emacs 23.1.1 on a machine whose "uname -a" says:

Linux bb003-centos-02 2.6.32-358.14.1.el6.x86_64 #1 SMP Tue Jul 16
23:51:20 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

-Jacob






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-10 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-08  1:42 bug#16686: 23.1; hexl-insert-hex-char shortens file by 7 bytes Jacob Burckhardt
2014-02-08  9:04 ` Eli Zaretskii
2014-02-08  9:24 ` Andreas Schwab
2014-02-10 19:55   ` Jacob Burckhardt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).