Bug and patch for MissingH filename globbing
Bug and patch for MissingH filename globbing

Hello,

Recently, I came across the HSH library. It looks really nice and I'm
planning on using it for writing a make-like tool in Haskell.

However, I discovered some unexpected behaviour of the glob function,
which I traced down to MissingH's System.Path.Glob. It seems to have
some trouble with patterns starting with "*".

I patched this module, using the newest version from the git repository,
so it gives (what I believe to be) the correct results for the erroneous
cases. Please read the comment in the patch to see what these cases are.

If there is something technically wrong with the patch (I am quite new
to git and to creating/submitting patches in general), please let me
know. Or, if my solution is broken, then just regard this e-mail as a
bug report.

Regards, and thanks in advance,
Jeroen Leeuwestein
(some random computer science student from The Netherlands)

From e9acff1f287831c8e815faf14fbc127050c9e323 Mon Sep 17 00:00:00 2001
From: Jeroen Leeuwestein <jeroenleeuwestein@gmail.com>
Date: Sat, 10 Jan 2009 17:54:32 +0100
Subject: [PATCH] Fix a few globbing bugs.

Setup a test in an empty directory:
  mkdir A
  touch A/text.txt

glob "*"
  old result: ["/A"]
  new result: ["A"]
glob $ "*/*" -- or anything starting with a star and then a non-wildcard character
  old result: []
  new result: ["A/text.txt"]
glob $ "/*"
  old result: ["//root", ...]
  new result: ["/root", ...]

haskellbr/missingh