Skip to content

Read Distro name from /etc/os-release#264

Merged
MrGlockenspiel merged 1 commit into
MrGlockenspiel:mainfrom
pludi:osrelease
Jul 19, 2026
Merged

Read Distro name from /etc/os-release#264
MrGlockenspiel merged 1 commit into
MrGlockenspiel:mainfrom
pludi:osrelease

Conversation

@pludi

@pludi pludi commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Not tested on BSD, macOS, Windows since I don't have any of those systems available.

* Reads the Distro name from /etc/os-release
* Code paths only compiled on Linux
* As requested in MrGlockenspiel#240 hidden behind new option
* Explanation in `ARGS.md`
@angelbuggirl

Copy link
Copy Markdown

no

@angelbuggirl

Copy link
Copy Markdown

nevermind yes

@MrGlockenspiel

MrGlockenspiel commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Handful of issues:

  • getline() isn't a standard function so it breaks Windows builds (or any other non-POSIX platform)
  • You leak both pretty and fallback in get_release_info(), and the return value is also leaked and unreachable when you call strcat() directly on the function call like that
  • The function copy_value() really has no reason to be exposed, it can be a static helper
  • The header osrelease.h is unguarded
  • FILE *osrelease is never closed

Other than those it looks good, I'll probably accept this and then commit the fixes since I've already written them, thank you

@MrGlockenspiel
MrGlockenspiel merged commit 517843c into MrGlockenspiel:main Jul 19, 2026
2 of 5 checks passed
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