Liste des Groupes | Revenir à cl c |
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:In a "C" file (of the Kornshell software) I stumbled across this
comment: "Each command in the history file starts on an even byte
and is null-terminated."
>
I wonder what's the reason behind that even-byte-alignment, on "C"
level or on Unix/files level. Any ideas?
This question led to a number of long digressions, most of which didn't
address the original question.
The quoted comment is in src/cmd/ksh93/edit/history.c in
<https://github.com/ksh93/ksh>. It goes on to mention versions 0
and 1 of the history file format.
I haven't been able to find sources for ksh that would shed any light on
this.
The even byte requirement in version 1 was likely inherited from version
0. The initial commit in the git repo includes release notes going back
to 1987, but no old versions of the source code.
My best guess is that the author of some early version of ksh, when
first defining the Version 0 history file format, just thought that even
byte alignment was a good idea at the time. There might not be any
deeper reason than that.
Les messages affichés proviennent d'usenet.