From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: Bibtex and latex export Date: Fri, 08 Oct 2010 20:03:22 +0200 Message-ID: <87pqvkimtx.fsf@Rainer.invalid> References: <4C9122FE.1080306@ccbr.umn.edu> <87aamra78p.fsf@mundaneum.com> <87pqvntldc.wl%ucecesf@ucl.ac.uk> <87d3rni6ea.fsf@Rainer.invalid> <87mxqqpjcf.wl%ucecesf@ucl.ac.uk> <18908.1286458199@gamaville.dokosmarshall.org> <87zkuqdrzr.wl%ucecesf@ucl.ac.uk> <87lj68zzmc.wl%ucecesf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=57998 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4HIG-0004sd-Js for emacs-orgmode@gnu.org; Fri, 08 Oct 2010 14:03:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4HID-0001wx-9g for emacs-orgmode@gnu.org; Fri, 08 Oct 2010 14:03:44 -0400 Received: from lo.gmane.org ([80.91.229.12]:45039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4HIC-0001wY-U4 for emacs-orgmode@gnu.org; Fri, 08 Oct 2010 14:03:41 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P4HI8-0001GF-Bs for emacs-orgmode@gnu.org; Fri, 08 Oct 2010 20:03:36 +0200 Received: from p57aadb5f.dip.t-dialin.net ([87.170.219.95]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Oct 2010 20:03:36 +0200 Received: from Stromeko by p57aadb5f.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Oct 2010 20:03:36 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org I'm pretty sure that this behaviour of egrep has been introduced with GNU grep version 2.6 (which says it fixed some long-standing bugs with regards to locale handling and character classes if you care to read the release notes). Unfortunately, as we see here, fixing bugs in one place often uncovers bugs someplace else, as the texi2dvi maintainers certainly didn't suspect a new version of grep to cause breakage. There are some bugs introduced with 2.6 that supposedly have been fixed in 2.7. Since the intent of the regex is obviously to allow an absolute path to start either with a "/" or a DOS drive letter, contrary to what I wrote before it is _not_ possible to use character classes as that would also allow extra characters not allowed in drive letters in most locales. Probably the most compatible version is to force the "C" locale for the egrep call in question and slightly modify the range expression: echo "$command_line_filename" | LC_ALL=C $EGREP '^(/|[A-Za-z]:/)' >&6 \ || command_line_filename="./$command_line_filename" Otherwise you can't really use range expressions or character classes at all since they either permit illegal drive letters or might not work with due to the bugs in older versions of grep... it would however be possible to spell out each drive letter bot in upper and lower case, although that handicaps the permissible length of the filename (if the "-i" switch wasn't broken in some locales one could use it and save one version of the cases): echo "$command_line_filename" | LC_ALL=C $EGREP \ '^(/|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]:/)' >&6 \ || command_line_filename="./$command_line_filename" *Shudder* :-) Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf Q+, Q and microQ: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds