summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/syncqt18
1 files changed, 5 insertions, 13 deletions
diff --git a/bin/syncqt b/bin/syncqt
index 15814df3f9..07b9d2432e 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -607,22 +607,14 @@ sub loadSyncProfile {
sub locateSyncProfile
{
my ($directory) = @_;
- my $syncprofile;
$directory = abs_path($directory);
- while(!defined $syncprofile) {
- local(*D);
- if (opendir(D, $directory)) {
- foreach my $file (sort readdir(D)) {
- next if ($file =~ /^\.\.?$/);
- $syncprofile = "$directory/$file" if ($file =~ /^sync\.profile$/);
- last if (defined $syncprofile);
- }
- closedir(D);
- }
- last if (defined $syncprofile || $directory eq "/" || $directory =~ /^?:[\/\\]$/);
+ while (1) {
+ my $file = $directory."/sync.profile";
+ return $file if (-e $file);
+ my $odir = $directory;
$directory = dirname($directory);
+ return undef if ($directory eq $odir);
}
- return $syncprofile;
}
# check if this is an in-source build, and if so use that as the basedir too