generate-cmdlist.sh: avoid selecting synopsis at wrong place
PATCH 1/1 generate-cmdlist.sh: avoid selecting synopsis at wrong place
In "common" man pages there is luckily no "NAME" anywhere except at beginning of documents. If there is another "NAME", sed could mis-select it and lead to common-cmds.h corruption. So better nail it at beginning of line, which would reduce corruption chance.
--- generate-cmdlist.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
generate-cmdlist.sh +1 -1
@@ -14,7 +14,7 @@ sort | while read cmd do sed -n ' - /NAME/,/git-'"$cmd"'/H + /^NAME/,/git-'"$cmd"'/H ${ x s/.*git-'"$cmd"' - \(.*\)/ {"'"$cmd"'", "\1"},/
Signature · 1 line
1.6.0.96.g2fad1.dirty
Quoted 5 lines · Nguyễn Thái Ngọc Duy
In "common" man pages there is luckily no "NAME" anywhere except at beginning of documents. If there is another "NAME", sed could mis-select it and lead to
common-cmds.hcorruption. So better nail it at beginning of line, which would reduce corruption chance.
You could narrow it even more with /^NAME$/
Santi
Quoted 9 lines · Santi Béjar
Quoted 5 lines · Nguyễn Thái Ngọc Duy
In "common" man pages there is luckily no "NAME" anywhere except at beginning of documents. If there is another "NAME", sed could mis-select it and lead to
common-cmds.hcorruption. So better nail it at beginning of line, which would reduce corruption chance.You could narrow it even more with /^NAME$/
That may miss "^NAME $", which is hard to recognize by eyes, although I'm pretty sure there is no trailing spaces in git. It's up to Junio to decide how strict he wants.
Signature · 1 line
Duy