This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fastjar question

Ranjit Mathew wrote:

Andreas Tobler wrote:

Second, this thing is much more annoying, the fastjar jar creates a ^@ entry as last 'character' in the MANIFEST. This is in my opinion wrong.

A look into the fastjar source I found the place and I modified it to ommit this ^@. Though, I don't understand the source. Here I'd like to hear if this is intended behaviour or a possible bug.
Below the diff.

Though you don't mention it, I'm guessing that you're
using vi(m) to view the manifest file. In this case,
ASCII NUL bytes (0x00) are shown as '^@' by the editor
and therefore this is most likely due to "overstorage"
of a string by the program.

That's why your fix fixes this problem.

And here the hex output to show Ranjit's correct statement. (emacs hexl-mode)

You see the last byte is a NUL we allocated to much.
Hehe, wonderful to have all the different editors :)

00000000: 4d61 6e69 6665 7374 2d56 6572 7369 6f6e  Manifest-Version
00000010: 3a20 312e 300a 4372 6561 7465 642d 4279  : 1.0.Created-By
00000020: 3a20 302e 3932 2d67 6363 0a0a 4d61 696e  : 0.92-gcc..Main
00000030: 2d43 6c61 7373 3a20 7369 6d70 6c65 0a00  -Class: simple..

Thanks again.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]