uucore::fsext: Fix mountinfo parsing w/ multiple optional fields#2778
Merged
Conversation
Contributor
|
Would it be possible to add a test for this? thanks |
2420330 to
bc7e4fc
Compare
Contributor
Author
|
@sylvestre done! |
sylvestre
reviewed
Dec 19, 2021
proc(5) mentions the following for the fields section and hyphen: > (7) optional fields: zero or more fields of the form "tag[:value]"; > see below. > (8) separator: the end of the optional fields is marked by a single > hyphen. IOW, there may actually be multiple optional fields, not just one, in which case the previously hardcoded indexes for the filesystem type and device name are now incorrect. Now, the filesystem type and device name are parsed relative to the hypen's location, ensuring that they will be correct regardless of the number of optional fields. Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
bc7e4fc to
23c0734
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
proc(5) mentions the following for the fields section and hyphen:
IOW, there may actually be multiple optional fields, not just one, in
which case the previously hardcoded indexes for the filesystem type and
device name are now incorrect. Now, the filesystem type and device name
are parsed relative to the hypen's location, ensuring that they will be
correct regardless of the number of optional fields.
Signed-off-by: Ryan Gonzalez ryan.gonzalez@collabora.com