{"thread":{"id":"43768","subject":"[patch] cg help broken when $PAGER contains space","startedAt":"2006-11-26T14:51:24Z","lastAt":"2006-11-26T14:51:24Z","messageCount":1,"participants":["Eric Blake"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"298399","messageId":"4569A9EC.6080805@byu.net","threadId":"43768","inReplyTo":null,"subject":"[patch] cg help broken when $PAGER contains space","fromName":"Eric Blake","fromEmail":"ebb9@byu.net","sentAt":"2006-11-26T14:51:24Z","receivedAt":"2006-11-26T14:51:24Z","isPatch":true,"sender":{"key":"eblake@redhat.com","avatar":"https://avatars.githubusercontent.com/u/32933908?v=4"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nWith cogito 0.18.1, cg-help line 152 invokes \"IFS=$'\\n' colorize\", which\nin turn invokes the \"pager\" shell function from cg-Xlib with IFS set to\njust a newline.  This means that if PAGER contains any spaces, the\nexpansion of ${PAGER:-less} within pager() will not be split, leading to\nthe following less-than-useful help message:\n\n$ echo $PAGER\nless -s\n$ cg help\n/usr/lib/cogito/cg-Xlib: line 193: less -s: command not found\n$ echo $?\n127\n\nThis patch fixes the problem:\n\n2006-11-26  Eric Blake  <ebb9@byu.net>\n\n\t* cg-help: Don't change IFS when invoking pager.\n\ndiff --git a/cg-help b/cg-help\nindex c2d558f..f428767 100755\n- --- a/cg-help\n+++ b/cg-help\n@@ -149,7 +149,7 @@ BRANCH_COMMANDS=\"$(ls \"$bin_path\"/cg-bra\n TAG_COMMANDS=\"$(ls \"$bin_path\"/cg-tag* | sed 's#.*/##' | tr '\\n' ' ')\"\n ADVANCED_COMMANDS=\"$(ls \"$bin_path\"/cg-admin-* | sed 's#.*/##' | tr '\\n'\n' ')\"\n\n- -IFS=$'\\n' colorize <<__END__\n+colorize <<__END__\n The Cogito version control system  $(cg-version)\n\n Available regular commands:\n\n- --\nLife is short - so eat dessert first!\n\nEric Blake             ebb9@byu.net\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.5 (Cygwin)\nComment: Public key at home.comcast.net/~ericblake/eblake.gpg\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org\n\niD8DBQFFaanr84KuGfSFAYARAmfSAKCZ15/oq3rwsPyB/XLNXpUWYzQRiACfeYcC\nDFw8ldbHVYs0vZtjynI3/hU=\n=rR/p\n"}]}