
ロケールファイルの上部に47行の空行があることを確認しました。
xb@dnxb:/usr/share/X11/locale$ hexdump -Cv locale.alias | head
00000000 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
00000010 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
00000020 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 23 |...............#|
00000030 0a 23 09 54 68 69 73 20 66 69 6c 65 20 63 6f 6e |.#.This file con|
00000040 74 61 69 6e 73 20 61 6c 69 61 73 20 6e 61 6d 65 |tains alias name|
00000050 20 6f 66 20 6c 6f 63 61 6c 65 2e 0a 23 09 45 61 | of locale..#.Ea|
00000060 63 68 20 61 6c 69 61 73 20 6e 61 6d 65 20 69 73 |ch alias name is|
00000070 20 64 65 73 63 72 69 62 65 64 20 77 69 74 68 69 | described withi|
00000080 6e 20 6f 6e 65 20 6c 69 6e 65 2e 0a 23 09 54 68 |n one line..#.Th|
00000090 65 20 66 69 72 73 74 20 77 6f 72 64 20 69 73 20 |e first word is |
xb@dnxb:/usr/share/X11/locale$ hexdump -Cv locale.dir | head
00000000 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
00000010 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
00000020 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 23 |...............#|
00000030 0a 23 09 54 68 69 73 20 66 69 6c 65 20 63 6f 6e |.#.This file con|
00000040 74 61 69 6e 73 20 6c 6f 63 61 6c 65 20 64 61 74 |tains locale dat|
00000050 61 62 61 73 65 20 66 69 6c 65 20 6e 61 6d 65 73 |abase file names|
00000060 0a 23 09 54 68 65 20 66 69 72 73 74 20 77 6f 72 |.#.The first wor|
00000070 64 20 69 73 20 74 68 65 20 6c 6f 63 61 6c 65 20 |d is the locale |
00000080 64 61 74 61 62 61 73 65 20 66 69 6c 65 20 6e 61 |database file na|
00000090 6d 65 20 61 6e 64 0a 23 09 74 68 65 20 73 65 63 |me and.#.the sec|
xb@dnxb:/usr/share/X11/locale$ hexdump -Cv compose.dir | head
00000000 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
00000010 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
00000020 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 23 |...............#|
00000030 0a 23 09 54 68 69 73 20 66 69 6c 65 20 63 6f 6e |.#.This file con|
00000040 74 61 69 6e 73 20 63 6f 6d 70 6f 73 65 20 74 61 |tains compose ta|
00000050 62 6c 65 20 66 69 6c 65 20 6e 61 6d 65 73 2e 0a |ble file names..|
00000060 23 09 54 68 65 20 66 69 72 73 74 20 77 6f 72 64 |#.The first word|
00000070 20 69 73 20 74 68 65 20 63 6f 6d 70 6f 73 65 20 | is the compose |
00000080 74 61 62 6c 65 20 66 69 6c 65 20 6e 61 6d 65 0a |table file name.|
00000090 23 09 61 6e 64 20 74 68 65 20 73 65 63 6f 6e 64 |#.and the second|
xb@dnxb:/usr/share/X11/locale$ hexdump -Cv C/XLC_LOCALE | head
00000000 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
00000010 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
00000020 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 23 |...............#|
00000030 20 20 58 4c 6f 63 61 6c 65 20 44 61 74 61 62 61 | XLocale Databa|
00000040 73 65 20 53 61 6d 70 6c 65 20 66 6f 72 20 43 2e |se Sample for C.|
00000050 0a 23 20 0a 0a 23 20 0a 23 20 09 58 4c 43 5f 46 |.# ..# .# .XLC_F|
00000060 4f 4e 54 53 45 54 20 63 61 74 65 67 6f 72 79 0a |ONTSET category.|
00000070 23 20 0a 58 4c 43 5f 46 4f 4e 54 53 45 54 0a 23 |# .XLC_FONTSET.#|
00000080 20 09 66 73 30 20 63 6c 61 73 73 20 28 37 20 62 | .fs0 class (7 b|
00000090 69 74 20 41 53 43 49 49 29 0a 66 73 30 09 7b 0a |it ASCII).fs0.{.|
xb@dnxb:/usr/share/X11/locale$
vi
ファイルだけを見て空白のページが表示されたら、おそらく下にスクロールせずに表示したcat
ときにのみわかります。確認するこの仕様しかし、47行の空行については言及していないようです。ロケールファイルの先頭にある47行の空行の目的は何ですか?
答え1
私はそれが何らかの理由で実際には存在しないと確信しています。これは、これらのファイルが構築される方法の副作用です。見たらlocale.aliasソース、欠落していることを確認できます(左側の数字は追加された行番号であり、実際にはファイルには存在しません)。
1 XCOMM
2 XCOMM This file contains alias name of locale.
3 XCOMM Each alias name is described within one line.
4 XCOMM The first word is the alias name (simplified locale name)
5 XCOMM the second word is full locale name.
6 XCOMM
7 XCOMM
8 POSIX: C
9 POSIX-UTF2: C
見たらfile.amの生成ファイルを生成するために、かなり多くのCプリプロセッサとsedを通過します。
locale.alias: locale.alias.pre
$(AM_V_GEN)$(RAWCPP) $(RAWCPPFLAGS) $(CPP_FILES_FLAGS) < $(srcdir)/locale.alias.pre | $(CPP_SED_MAGIC) > locale.alias.l1
$(SED) -e '/^[^#][^ ]*:/s/://' -e '/^[^#].*[ ].*:/d' \
< locale.alias.l1 > locale.alias.l2
cat locale.alias.l2 locale.alias.l1 > locale.alias
見たらfile.inの生成、CPP_SED_MAGIC
例:
CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
-e '/^\#line *[0-9][0-9]* *.*$$/d' \
-e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \
-e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
-e '/^[ ]*XHASH/s/XHASH/\#/' \
-e 's,X11_LOCALEDATADIR,$(X11_LOCALEDATADIR),g' \
-e '/\@\@$$/s/\@\@$$/\\/'
とりわけ、Cプリプロセッサが吐き出すすべての行番号コメントを空白行に置き換えます。これが彼らが来た場所です。