Summary
On some systems, bsd_glob() called without explicit flags fails to expand wildcard patterns and returns the literal pattern string instead of matching files. This causes Shutter's profile combobox to show only a single entry named * after restart — all saved profiles are invisible.
Steps to reproduce
- Create one or more profiles via Preferences
- Quit Shutter fully (via tray → Quit)
- Relaunch Shutter
- Open Preferences — profile combobox shows only
*, no saved profiles listed
Root cause
Line 888 of /usr/bin/shutter:
foreach my $pfile (sort bsd_glob("$ENV{'HOME'}/.shutter/profiles/*.xml")) {
bsd_glob() without explicit flags has platform-dependent default behaviour. On affected systems it returns the literal string ~/.shutter/profiles/*.xml when the flags default in a way that triggers GLOB_NOCHECK-style fallback. Perl's built-in glob() does not have this variance.
Reproducing the difference in Perl:
use File::Glob qw(bsd_glob);
# Returns literal '*.xml' pattern on affected systems:
my @a = bsd_glob("$ENV{'HOME'}/.shutter/profiles/*.xml");
# Returns all matching files correctly:
my @b = glob("$ENV{'HOME'}/.shutter/profiles/*.xml");
Fix
Replace bsd_glob with the built-in glob on line 888:
# Before
foreach my $pfile (sort bsd_glob("$ENV{'HOME'}/.shutter/profiles/*.xml")) {
# After
foreach my $pfile (sort glob("$ENV{HOME}/.shutter/profiles/*.xml")) {
glob() is the idiomatic Perl choice for simple patterns and delegates to File::Glob internally on modern Perl without the flag-dependent variance. No other behaviour is affected — the pattern doesn't use brace expansion or any feature exclusive to bsd_glob.
Environment
- Shutter 0.99.2 Rev.1593
- Perl (system), Linux/Ubuntu
Summary
On some systems,
bsd_glob()called without explicit flags fails to expand wildcard patterns and returns the literal pattern string instead of matching files. This causes Shutter's profile combobox to show only a single entry named*after restart — all saved profiles are invisible.Steps to reproduce
*, no saved profiles listedRoot cause
Line 888 of
/usr/bin/shutter:bsd_glob()without explicit flags has platform-dependent default behaviour. On affected systems it returns the literal string~/.shutter/profiles/*.xmlwhen the flags default in a way that triggersGLOB_NOCHECK-style fallback. Perl's built-inglob()does not have this variance.Reproducing the difference in Perl:
Fix
Replace
bsd_globwith the built-inglobon line 888:glob()is the idiomatic Perl choice for simple patterns and delegates toFile::Globinternally on modern Perl without the flag-dependent variance. No other behaviour is affected — the pattern doesn't use brace expansion or any feature exclusive tobsd_glob.Environment