bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

b4_basename minor cleanup


From: Paul Eggert
Subject: b4_basename minor cleanup
Date: Sat, 08 Jul 2006 21:40:43 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

A minor point: b4_basename doesn't really implement the full POSIX
basename, but it doesn't need to, so it can be simplified a bit to
avoid confusion.  I installed this.

2006-07-08  Paul Eggert  <address@hidden>

        * data/c.m4 (b4_basename): Simplify a bit, since we don't
        need the full POSIX semantics (and weren't implementing them
        anyway).

--- data/c.m4   8 Jul 2006 20:38:14 -0000       1.60
+++ data/c.m4   9 Jul 2006 04:37:04 -0000
@@ -410,17 +410,16 @@ m4_define([b4_c_arg],
 
 # b4_basename(NAME)
 # -----------------
+# Similar to POSIX basename; the differences don't matter here.
 # Beware that NAME is not evaluated.
 m4_define([b4_basename],
-[m4_case([$1],
-         [/], [/],
-             [m4_bpatsubst([$1], [^.*/\([^/]+\)/?$], [\1])])])
-        
+[m4_bpatsubst([$1], [^.*/\([^/]+\)/*$], [\1])])
+
 
 # b4_syncline(LINE, FILE)
 # -----------------------
 m4_define([b4_syncline],
-[b4_flag_if([synclines], 
+[b4_flag_if([synclines],
 [/* Line __line__ of b4_basename(m4_quote(__file__)).  */
 [#]line $1 $2])])
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]