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
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.