From nobody Thu Dec 28 10:51:49 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T15120Nwlz55bBY; Thu, 28 Dec 2023 10:51:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T151174Rzz3bmH; Thu, 28 Dec 2023 10:51:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703760710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t7UrCoYgZ0Xonmh+5VAVWAbsoMEOIX8n9beXhzLKhIw=; b=Tfda5/2q73tM+kJ8PuY+9L7cq45zJVgyaRMU/sxSTcqS/Igm4tA6wsc5CRlAKAVqIg6dpk 1fm9humLawdatekCfTjJ7zutnFePn55k5xl9p/P8kg4Q/yMHrkPoQSlHK5LaHeMx+bfGpr IVDlIHi8JIDJmDk0BetOWIUweeoJuSJ6s4VWsyDTzoMwdHIve0S+4pQHLUartiPvWbgioc 9rHJW95I1oV1oBM+7cj8DmXwKUrv436qbN+0wgz2guLZfjPB47KBhGxLfun+Vk6eiHtUgh C4sD3g7z1zawPMGplm2TF3eo+S8u0WPdTmCDrdtAgeok2B5kWTBVl/JlfADa+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703760710; a=rsa-sha256; cv=none; b=gpbdWdakGHt2xfUyWcWLveUTtf0eQzViKdYIOSdi+c12GCDqveg8Iynn85Ke65eSMBXTH+ G2V/8HE8pFntQKnKZGOkUx4luREVo7KnUm7bUXvtNkqbXD2X6gIEOPKtfrl1HlrFe+QYOI itjPDmqfvJ2E8ywiRHQ6sVBZnC6lUhvu51cjV1Z23n8s0fm9SMIQVAAe/EA052/iC9sdng sTCsVgF+OGhir7uJVsvqL+z9mRMK7dAk1/yn5zUOOuo7J8AreGrlAMT7uvR/0xPy42e1jG UoCkadyvJZ+gY8TPbVZSdqft2qL2LPdpnfkjmdiB7tklsLc1QegeOPvdMGMFTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703760710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t7UrCoYgZ0Xonmh+5VAVWAbsoMEOIX8n9beXhzLKhIw=; b=hiSW4F6MDOuAqvmMvrCI9j+z4pAK8x3UEYnudvF1yPfg9BiECtPoOD9p9pSS4LFNGORvfp lht9GKVaULf2VhwOpA2ZUrQ5Ygjtcs8HN3A//eYK1ZdSJmzD4czndQPEMB+5bciY+3oYet n0XZMlHpkApqKnbfUPSC1kIfZKjBpspj3YEb2owzgJ/a51Orn0JsEKT0jJeioP80jLFAKx A+bniS3e1WEpOBZdcUdEURUn3eLydcYYoh+hjUhz6qbT/fMQ2DoExAy/PJZB6+qMmnEfU5 psdMN997FU8iCbY1RljQo0hrqPfLH/QwuTnRNOkYGhwXmfLpbp5PHv4zyadSAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T1511673Hz4Nw; Thu, 28 Dec 2023 10:51:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BSApn5b029661; Thu, 28 Dec 2023 10:51:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BSApnCo029658; Thu, 28 Dec 2023 10:51:49 GMT (envelope-from git) Date: Thu, 28 Dec 2023 10:51:49 GMT Message-Id: <202312281051.3BSApnCo029658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 789480702e49 - main - support spaces in filenames List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 789480702e490818244af11279868ba4f3dabe6b Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=789480702e490818244af11279868ba4f3dabe6b commit 789480702e490818244af11279868ba4f3dabe6b Author: Wolfram Schneider AuthorDate: 2023-12-28 10:50:29 +0000 Commit: Wolfram Schneider CommitDate: 2023-12-28 10:50:29 +0000 support spaces in filenames PR: 275978 MFC after: 1 week --- usr.bin/man/man.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 87594699b2c2..66af46a36243 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -158,14 +158,14 @@ check_man() { if exists "$1"; then # We have a match, check for a cat page manpage=$found - setup_cattool $manpage - decho " Found manpage $manpage" + setup_cattool "$manpage" + decho " Found manpage \"$manpage\"" if [ -n "${use_width}" ]; then # non-standard width unset use_cat decho " Skipping catpage: non-standard page width" - elif exists "$2" && is_newer $found $manpage; then + elif exists "$2" && is_newer $found "$manpage"; then # cat page found and is newer, use that use_cat=yes catpage=$found @@ -308,7 +308,7 @@ man_check_for_so() { # We need to loop to accommodate multiple .so directives. while true do - line=$($cattool $manpage | head -1) + line=$($cattool "$manpage" | head -1) case "$line" in .so*) trim "${line#.so}" decho "$manpage includes $tstr" @@ -338,7 +338,7 @@ man_display_page() { # just zcat the catpage and we are done. if [ -z "$tflag" -a -n "$use_cat" ]; then if [ -n "$wflag" ]; then - echo "$catpage (source: $manpage)" + echo "$catpage (source: \"$manpage\")" ret=0 else if [ $debug -gt 0 ]; then @@ -496,8 +496,8 @@ man_find_and_display() { decho "Found a usable page, displaying that" unset use_cat manpage="$1" - setup_cattool $manpage - if man_check_for_so $manpage $(dirname $manpage); then + setup_cattool "$manpage" + if man_check_for_so "$manpage" "$(dirname \"$manpage"")"; then found_page=yes man_display_page fi @@ -516,7 +516,7 @@ man_find_and_display() { # Check if there is a MACHINE specific manpath. if find_file $p $sect $MACHINE "$1"; then - if man_check_for_so $manpage $p; then + if man_check_for_so "$manpage" $p; then found_page=yes man_display_page if [ -n "$aflag" ]; then @@ -530,7 +530,7 @@ man_find_and_display() { # Check if there is a MACHINE_ARCH # specific manpath. if find_file $p $sect $MACHINE_ARCH "$1"; then - if man_check_for_so $manpage $p; then + if man_check_for_so "$manpage" $p; then found_page=yes man_display_page if [ -n "$aflag" ]; then @@ -543,7 +543,7 @@ man_find_and_display() { # Check plain old manpath. if find_file $p $sect '' "$1"; then - if man_check_for_so $manpage $p; then + if man_check_for_so "$manpage" $p; then found_page=yes man_display_page if [ -n "$aflag" ]; then @@ -560,7 +560,7 @@ man_find_and_display() { # Nothing? Well, we are done then. if [ -z "$found_page" ]; then - echo "No manual entry for $1" >&2 + echo "No manual entry for \"$1\"" >&2 ret=1 return fi @@ -1040,8 +1040,8 @@ do_man() { do_full_search "${REGEXP}" fi - for page in $pages; do - decho "Searching for $page" + for page in "$pages"; do + decho "Searching for \"$page\"" man_find_and_display "$page" done