From mint-bounce@lists.fishpool.fi  Wed Feb  3 18:56:27 2010
X-Authenticated: #48718759
X-Provags-ID: V01U2FsdGVkX1+QzpIWKNuQlh1DpF+i+116sJ5CpKvawW2oRWkJNk
	y0bk7kimNOfdNQ
Message-ID: <797956.630445214-sendEmail@descaro>
From: "Helmut Karlowski" <hk10@gmx.de>
To: "alanh@fairlite.co.uk" <alanh@fairlite.co.uk>,
        "mint@lists.fishpool.fi" <mint@lists.fishpool.fi>
Cc: "hk10@gmx.de" <hk10@gmx.de>
Subject: [MiNT] patch::match
Date: Wed, 3 Feb 2010 23:55:18 +0000
X-Mailer: sendEmail-1.55
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----MIME delimiter for sendEmail-637805.957886489"
X-Antivirus: avast! (VPS 100203-1, 03.02.2010), Outbound message
X-Antivirus-Status: Clean
X-Y-GMX-Trusted: 0
X-FuHaFi: 0.82999999999999996,0.68999999999999995
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-to: mint-bounce@lists.fishpool.fi
X-original-sender: hk10@gmx.de
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>

This is a multi-part message in MIME format. To properly display this message you need a MIME-Version 1.0 compliant Email program.

------MIME delimiter for sendEmail-637805.957886489
Content-Type: text/plain;
  charset="iso-8859-1"
  Content-Transfer-Encoding: quoted-printable

Fileselector now matches *-patterns from the end

-----------------------------------------------------------
Longest possible match for '*' is used.
This enables the pattern '*.pat' to match for example abc.xy.pat.
-----------------------------------------------------------


------MIME delimiter for sendEmail-637805.957886489
Content-Type: text/plain;
 name="match.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="match.patch"

--- src.km/matchpat.c	4 Jan 2010 22:31:11 -0000	1.5.10.1
+++ src.km/matchpat.c	3 Feb 2010 23:05:18 -0000
@@ -95,9 +95,8 @@
 			case '*':
 			{
 				pat++;
-				//while (*t && (toupper(*t) != toupper(*pat)))
-				while (*t && *t != *pat)
-					t++;
+				/* match from end */
+				t = strrchr( t, *pat );
 				break;
 			}
 			/* !X means any character but X */
@@ -189,8 +188,8 @@
 			case '*':
 			{
 				pat++;
-				while (*t && (toupper(*t) != toupper(*pat)))
-					t++;
+				/* match from end */
+				t = t + strlen(t);
+				for( t--; t >= s && toupper(*t) != toupper(*pat); t-- );
 				break;
 			}
 			/* !X means any character but X */

------MIME delimiter for sendEmail-637805.957886489--


