From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80534 Path: news.gmane.org!not-for-mail From: Andre Caldas Newsgroups: gmane.comp.tex.context Subject: Bug when stripping file name suffix. Date: Wed, 30 Jan 2013 12:00:54 -0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1359554481 17827 80.91.229.3 (30 Jan 2013 14:01:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jan 2013 14:01:21 +0000 (UTC) To: ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 30 15:01:41 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U0YEP-00042a-CQ for gctc-ntg-context-518@m.gmane.org; Wed, 30 Jan 2013 15:01:41 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 743A71024C; Wed, 30 Jan 2013 15:01:23 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bCqq84f05ZnM; Wed, 30 Jan 2013 15:01:18 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 1657010217; Wed, 30 Jan 2013 15:01:18 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 111C210217 for ; Wed, 30 Jan 2013 15:01:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2kVMAoUxywxu for ; Wed, 30 Jan 2013 15:01:16 +0100 (CET) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 2B32B10215 for ; Wed, 30 Jan 2013 15:01:15 +0100 (CET) Original-Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r0UE1FQU032248 for ; Wed, 30 Jan 2013 15:01:15 +0100 Original-Received: by mail-lb0-f173.google.com with SMTP id gf7so2170042lbb.18 for ; Wed, 30 Jan 2013 06:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=xroZYTDdRxRHCMzb5YeNkdW6L98Wfugdcg/j9fO0NKA=; b=Gkwp5aqialvrZukwXBSGra9I0kugNJESnmFc4y/4w9VmkME3TwLxhZJD0GChKNj+7V 8bWzgwOVp98RTVzGgnoGERWUjiv6+yhQdqPgCOUEkS7Vfl9mJTNA7eDdSPnCkgmcCT0P rQhia2TnDA/VSKHkvWbwoSNsbZF3q1ESmMieprUPUgncCFDULg5toiN8vcY64wNj5OC7 Bw+o1hfIy807+CNqokz9xOZ3iF4fn+IoP/F6glkLk+eMu8u1fu8scCw8xBoY4mg+4d1/ nSSQdMA6jjdtKyxW3joG50G2U5oNbisRRgYhYYDnrpwMXX4npWUw98ogDX7zFys+hKdH HnPg== X-Received: by 10.152.123.194 with SMTP id mc2mr4245846lab.7.1359554474712; Wed, 30 Jan 2013 06:01:14 -0800 (PST) Original-Received: by 10.112.22.200 with HTTP; Wed, 30 Jan 2013 06:00:54 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.217.173; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06ISe1f6w - 2d4f7e3a9366 - 20130130 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:80534 Archived-At: Hello! The file tex/context/base/l-file.lua has a small bug in function remove suffix. The problem is that strings like path/./to/file become path/ Here is a fix: diff --git a/tex/context/base/l-file.lua b/tex/context/base/l-file.lua index e91eeac..bb63359 100644 --- a/tex/context/base/l-file.lua +++ b/tex/context/base/l-file.lua @@ -166,7 +166,7 @@ end -- inspect(file.nametotable("dir/file.ext")) -- inspect(file.nametotable("/dir/file.ext")) -local pattern = Cs(((period * noperiod^1 * -1)/"" + 1)^1) +local pattern = Cs(((period * (1-period-slashes)^1 * -1)/"" + 1)^1) function file.removesuffix(name) return name and lpegmatch(pattern,name) ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________