Skip to content

PATH_MAX is not portable -- do not use#204

Merged
djw8605 merged 1 commit into
scitokens:masterfrom
ellert:no-pathmax
Feb 24, 2026
Merged

PATH_MAX is not portable -- do not use#204
djw8605 merged 1 commit into
scitokens:masterfrom
ellert:no-pathmax

Conversation

@ellert
Copy link
Copy Markdown
Contributor

@ellert ellert commented Feb 24, 2026

scitokens-cpp-1.3.0/test/test_utils.h:43:26: error: ‘PATH_MAX’ was not declared in this scope

scitokens-cpp-1.3.0/test/test_utils.h:43:26: error: ‘PATH_MAX’ was not declared in this scope
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a portability issue where PATH_MAX is not available on all systems (causing compilation failures). The code is replaced with a POSIX-compliant approach using getcwd(nullptr, 0) which dynamically allocates the buffer for the current working directory.

Changes:

  • Replaced fixed-size buffer using PATH_MAX with dynamic allocation via getcwd(nullptr, 0)
  • Added proper memory cleanup with free() after use

Comment thread test/test_utils.h
@djw8605 djw8605 merged commit e414d22 into scitokens:master Feb 24, 2026
18 checks passed
@ellert ellert deleted the no-pathmax branch February 25, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants