Skip to content

Commit f0b68f0

Browse files
jonathantanmygitster
authored andcommitted
CodingGuidelines: use octal escapes, not hex
Extend the shell-scripting section of CodingGuidelines to suggest octal escape sequences (e.g. "\302\242") over hexadecimal (e.g. "\xc2\xa2") since the latter can be a source of portability problems. Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fe86abd commit f0b68f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Documentation/CodingGuidelines

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ For shell scripts specifically (not exhaustive):
188188
hopefully nobody starts using "local" before they are reimplemented
189189
in C ;-)
190190

191+
- Use octal escape sequences (e.g. "\302\242"), not hexadecimal (e.g.
192+
"\xc2\xa2") in printf format strings, since hexadecimal escape
193+
sequences are not portable.
194+
191195

192196
For C programs:
193197

0 commit comments

Comments
 (0)