Skip to content

Finished some details to be sure parsing is robust and already working following the necessary rules - #39

Merged
Melow-code merged 25 commits into
mainfrom
test-parsing
Nov 16, 2026
Merged

Melow-code merged 25 commits into
mainfrom
test-parsing

Conversation

@Melow-code

@Melow-code Melow-code commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Changes

  • Header validation: Now reports all missing headers instead of stopping at the first one.
  • Validation flow: Fixed validate() to stop on header errors before checking the map.
  • Map order: Added check_map_last() to reject headers appearing after the map.
  • Map detection: Added find_start_map() to recognize maps starting with spaces or tabs.
  • Empty lines: Updated skip_empty() to skip blank lines before the map and reject them inside it.
  • Map boundaries: Added bounds checks before accessing neighboring cells, preventing out-of-bounds reads.
  • Player parsing: Fixed the first column being skipped and converted N/S/E/W directly into the player's orientation enum.
  • Texture validation: Added .xpm extension and regular-file checks, with proper FD cleanup.
  • Memory management: Added cleanup of previously allocated map data when expand_map() fails.
  • Testing: Added multiple .cub files covering invalid headers, textures, player positions, map order, and wall boundaries.

@Melow-code Melow-code added this to the Mandatory milestone Nov 16, 2026
@Melow-code Melow-code moved this from Backlog to Ready in CUB3D Nov 16, 2026
@Melow-code Melow-code added parsing Reading and checking the .cub file Validation Validate output/input labels Nov 16, 2026
@Melow-code Melow-code self-assigned this Nov 16, 2026
@Melow-code
Melow-code marked this pull request as ready for review November 16, 2026 13:39
@Melow-code Melow-code linked an issue Nov 16, 2026 that may be closed by this pull request
@Melow-code
Melow-code removed the request for review from SailMasterG November 16, 2026 15:29
@Melow-code
Melow-code merged commit 7450c4d into main Nov 16, 2026
4 checks passed
@Melow-code
Melow-code deleted the test-parsing branch November 16, 2026 15:29
@github-project-automation github-project-automation Bot moved this from Ready to Done in CUB3D Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parsing Reading and checking the .cub file Validation Validate output/input

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Require the map to be last

1 participant