From nobody Mon Jun 05 09:46:19 2023 X-Original-To: bugs@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 4QZTJY1090z4Z6P8 for ; Mon, 5 Jun 2023 09:46:21 +0000 (UTC) (envelope-from bugzilla-noreply@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 4QZTJX4tpmz4JPb for ; Mon, 5 Jun 2023 09:46:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685958380; 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: in-reply-to:in-reply-to:references:references; bh=GgH7uMgq2y7ybdFZn0fBowwGDoZ6hNCeNhYRPT8a94o=; b=wYjDhufxbtp46iDGsKXvtMdbNWNDqzXM0nYTMSJOsDuJZ25cWhsDDb2lG7I+1GKez8wlJ9 LiEzQsVsvwhXKmjq6JZ4cYmmAlPd8UWkkIgdZH2Apr/yKkxQZ+8RrO8Ovaog2w0nPHztJE VKdS/UpsqrLGtQ/4kwjxBUWXstZzNS//j6NMk4Sp2NB4JNIhXLZCYzA+o9mDHmTqk8GEKF Cx5GFe1kuTssmKkh0MX/VTInKtRnSxdwKZG2ovkIuOcxBTMqdI6VeZIsQKbfRULaxv1mHt mrA5wnN9tWuKskyUJyQiPYnFc4InLRXmzLxDECwL7YFI+RWhDSAoc1y+usvRmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685958380; a=rsa-sha256; cv=none; b=oAz/JWY7lnC8IJTN7ICDy85b9Mq4UKMbthoKk5pVO6axwYmR++evXBiEERqBJ9g35DO50P cfOXo7KbCmMo7TC2lOS7pIcIlWXuG61QNnoQmmiN25Ko7FnEE3YhhVjgJI45BwfQU+ie9v rTbh2Es6u1FWx3E3kQb+awZ/o8IXljSHiaAa6k6gRL5tktpnsiziZfmqIRxUHGdQPsP3vN PljBHimW2drVEwefrxQTbpY94rww7Qdbvoyf7rbgbPeUT55qTsjRyiVPtCkMwvsfo+fPJf jVTJPPbOVMr7VTDD3c+FKbXzis6gYtaBk6kCERvABx0qyxqe4oImqDZzbF2wAw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4QZTJW3rtkzjKm for ; Mon, 5 Jun 2023 09:46:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 3559kJ9G000976 for ; Mon, 5 Jun 2023 09:46:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3559kJdg000975 for bugs@FreeBSD.org; Mon, 5 Jun 2023 09:46:19 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 271830] man: ignores MANSECT and -S Date: Mon, 05 Jun 2023 09:46:19 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: mohd.akram@outlook.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271830 --- Comment #4 from Mohamed Akram --- Comment on attachment 242606 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D242606 patch to fix the issue --- man.sh.orig 2023-06-05 09:11:06.617877000 +0000 +++ man.sh 2023-06-05 09:43:16.432524000 +0000 @@ -562,7 +562,7 @@ P) MANPAGER=3D$OPTARG ;; S) MANSECT=3D$OPTARG ;; a) aflag=3Daflag ;; - d) debug=3D$(( $debug + 1 )) ;; + d) ;; # handled in man_setup f) fflag=3Dfflag ;; h) man_usage 0 ;; k) kflag=3Dkflag ;; @@ -603,7 +603,7 @@ fi IFS=3D: - for sect in $man_default_sections; do + for sect in $MANSECT; do if [ "$sect" =3D "$1" ]; then decho "Detected manual section as first arg: $1" MANSECT=3D"$1" @@ -619,6 +619,15 @@ # Usage: man_setup # Setup various trivial but essential variables. man_setup() { + local cmd_arg + # Parse the debug flag prior to everything + OPTIND=3D1 + while getopts ':d' cmd_arg; do + case "${cmd_arg}" in + d) debug=3D$(( $debug + 1 )) ;; + esac + done + # Setup machine and architecture variables. if [ -n "$mflag" ]; then MACHINE_ARCH=3D${mflag%%:*} @@ -787,8 +796,8 @@ trim "${line#MANCONFIG}" config_local=3D"$tstr" ;; - # Set variables in the form of FOO_BAR - *_*[\ \ ]*) var=3D"${line%%[\ \ ]*}" + # Set other variables + *[\ \ ]*) var=3D"${line%%[\ \ ]*}" trim "${line#$var}" eval "$var=3D\"$tstr\"" decho " Parsed $var" 3 @@ -1008,12 +1017,12 @@ } do_man() { + man_setup "$@" man_parse_args "$@" if [ -z "$pages" -a -z "${Kflag}" ]; then echo 'What manual page do you want?' >&2 exit 1 fi - man_setup if [ ! -z "${Kflag}" ]; then # Short circuit because -K flag does a sufficiently --=20 You are receiving this mail because: You are the assignee for the bug.=