[Bugfix] Sort network mounts alphabetically#3695
Open
xavierjurado wants to merge 1 commit intolinuxmint:masterfrom
Open
[Bugfix] Sort network mounts alphabetically#3695xavierjurado wants to merge 1 commit intolinuxmint:masterfrom
xavierjurado wants to merge 1 commit intolinuxmint:masterfrom
Conversation
mtwebster
reviewed
Feb 5, 2026
| sort_mounts_func(gconstpointer a, | ||
| gconstpointer b) | ||
| { | ||
| g_autofree gchar *name_a, *name_b = NULL; |
Member
There was a problem hiding this comment.
g_autofree can only be used on one variable at a time - you need to declare name_a and name_b on separate lines, or else name_b won't get freed automatically.
g_autofree gchar *name_a = NULL;
g_autofree gchar *name_b = NULL;though they don't necessarily need to initialize to NULL - in a simple function like this I think it's ok to combine it with the assignment below:
g_autofree gchar *name_a = g_mount_get_name (G_MOUNT(a));
g_autofree gchar *name_b = g_mount_get_name (G_MOUNT(b));The important thing is making sure these get some sort of value before the function exits, for autofree not to crash.
Also, please keep a space between function name and opening parentheses in all changes:
// good
return g_utf8_collate (name_a, name_b);
// bad
return g_utf8_collate(name_a, name_b);
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.
This is a fix for #3687, sorting network mounts alphabetically in the sidebar.
I didn't find any contributing guidelines in the repository, so please advice if something isn't quite right.