~sircmpwn/hare-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH hautils] pwd: Do not reassign mode on pwd -L

Details
Message ID
<20230605181110.20438-1-noah@altun.cc>
DKIM signature
pass
Download raw message
Patch: +1 -1
When ./pwd -L is invoked, mode is reassigned to mode::NORM, which
is the default value. In this case we can simply use 'void'.
---
 pwd.ha | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pwd.ha b/pwd.ha
index bf095f4..2643629 100644
--- a/pwd.ha
+++ b/pwd.ha
@@ -26,7 +26,7 @@ export fn utilmain() (main::error | void) = {
		const opt = cmd.opts[i];
		switch (opt.0) {
		case 'L' =>
			mode = mode::NORM;
			void;
		case 'P' =>
			mode = mode::REAL;
		case => abort();
-- 
2.34.1
Details
Message ID
<CT4XWYETGGOU.29UK6GC1TT5ME@desktop>
In-Reply-To
<20230605181110.20438-1-noah@altun.cc> (view parent)
DKIM signature
pass
Download raw message
On Mon Jun 5, 2023 at 21:11 MSK, Noah Altunian wrote:
> When ./pwd -L is invoked, mode is reassigned to mode::NORM, which
> is the default value. In this case we can simply use 'void'.

This causes problems if both -L and -P are given. `pwd -PL` would have
mode::REAL and as per POSIX,
"If both -L and -P are specified, the last one shall apply" -- pwd(1P),
so it should have mode::NORM instead.
Details
Message ID
<2018175033.274243.1685991549307@privateemail.com>
In-Reply-To
<CT4XWYETGGOU.29UK6GC1TT5ME@desktop> (view parent)
DKIM signature
pass
Download raw message
This makes sense. Thank you for the clarification.
Reply to thread Export thread (mbox)