wavefnd / wavefnd/Wave

Fix env_exists for environment values longer than one byte

Open
#423 0 comments 0 reactions 0 assignees View on GitHub
bug good first issue needs testing
Dominant language
Rust
Stars
53
Forks
16
Avg merge
4h 22m
Merged PRs (30d)
46

Description

## Summary

`std::env::env_exists` currently uses a two-byte destination buffer and treats every negative `env_get` result as “not present”. Any environment value longer than one byte therefore produces the buffer-too-small result and is incorrectly reported as absent.

## Relevant code

- `std/env/environ.wave`
- `std/env/parse.wave`

## Scope

Make presence detection independent of the destination capacity needed to copy the value. Preserve the existing public API and integer error conventions unless a small internal helper is needed.

## Acceptance criteria

- A missing key returns `false`.
- An empty value returns `true`.
- One-byte and multi-byte values return `true`.
- Presence detection does not require copying the full value.
- Regression coverage is added to the Wave test corpus.
- Existing standard-library examples and native CI targets continue to pass.

Contributor guide

Open the contributing guide

Research direction

Start by reading std/env/environ.wave and std/env/parse.wave to trace env_exists and the existing env_get error conventions. Run the relevant Wave standard-library tests before changing anything, then add regression coverage to the Wave test corpus. Done means missing, empty, one-byte, and multi-byte values all report the specified presence result without copying the full value, while existing examples and native CI targets pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.