Skip to content

Fix env_exists for environment values longer than one byte #423

Closed

Description

@LunaStev

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.

Activity

  1. added
    bug
    good first issue
    needs testing
    on Aug 29, 2026
  2. self-assigned this
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issueneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions