Skip to content

Commit

Permalink
Linux (GTK, Portal): Fix unintended wchar_t literals (#160)
Browse files Browse the repository at this point in the history
The existing code is technically correct, but using `wchar_t` literals are unintended since we always use UTF-8 on Linux (both GTK and Portal).
  • Loading branch information
btzy authored Mar 3, 2025
1 parent 7dffc10 commit 77b392a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/nfd_gtk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void AddFiltersToDialog(GtkFileChooser* chooser,
// count number of file extensions
size_t sep = 1;
for (const nfdnchar_t* p_spec = filterList[index].spec; *p_spec; ++p_spec) {
if (*p_spec == L',') {
if (*p_spec == ',') {
++sep;
}
}
Expand Down Expand Up @@ -192,7 +192,7 @@ Pair_GtkFileFilter_FileExtension* AddFiltersToDialogWithMap(GtkFileChooser* choo
// count number of file extensions
size_t sep = 1;
for (const nfdnchar_t* p_spec = filterList[index].spec; *p_spec; ++p_spec) {
if (*p_spec == L',') {
if (*p_spec == ',') {
++sep;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/nfd_portal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void AppendSingleFilter(DBusMessageIter& base_iter, const nfdnfilteritem_t& filt
// count number of file extensions
size_t sep = 1;
for (const char* p = filter.spec; *p; ++p) {
if (*p == L',') {
if (*p == ',') {
++sep;
}
}
Expand Down Expand Up @@ -346,7 +346,7 @@ bool AppendSingleFilterCheckExtn(DBusMessageIter& base_iter,
// count number of file extensions
size_t sep = 1;
for (const char* p = filter.spec; *p; ++p) {
if (*p == L',') {
if (*p == ',') {
++sep;
}
}
Expand Down

0 comments on commit 77b392a

Please sign in to comment.