fix for corner case involving symlinks
diff --git a/doublestar.go b/doublestar.go
index dbfc7b4..4228a18 100644
--- a/doublestar.go
+++ b/doublestar.go
@@ -189,7 +189,13 @@
   }
 
   // otherwise, we need to check each item in the directory...
-  // so confirm it's a directory first...
+  // first, if basedir is a symlink, follow it...
+  if fi.Mode() & os.ModeSymlink != 0 {
+    fi, err = os.Stat(basedir)
+    if err != nil { return }
+  }
+
+  // confirm it's a directory...
   if !fi.IsDir() { return }
 
   // read directory
diff --git a/doublestar_test.go b/doublestar_test.go
index 1d45ae8..0ba0b63 100644
--- a/doublestar_test.go
+++ b/doublestar_test.go
@@ -84,6 +84,8 @@
   {"abc**", "abc", true, nil, true},
   {"**abc", "abc", true, nil, true},
   {"broken-symlink", "broken-symlink", true, nil, true},
+  {"working-symlink/c/*", "working-symlink/c/d", true, nil, true},
+  {"working-sym*/*", "working-symlink/c", true, nil, true},
 }
 
 func TestMatch(t *testing.T) {
diff --git a/test/abc/working-symlink b/test/abc/working-symlink
new file mode 120000
index 0000000..21792ad
--- /dev/null
+++ b/test/abc/working-symlink
@@ -0,0 +1 @@
+working-symlink
\ No newline at end of file
diff --git a/test/working-symlink b/test/working-symlink
new file mode 120000
index 0000000..db89c97
--- /dev/null
+++ b/test/working-symlink
@@ -0,0 +1 @@
+a/b
\ No newline at end of file