]> git.saurik.com Git - bison.git/commitdiff
* data/c.m4 (b4_basename): Simplify a bit, since we don't
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 9 Jul 2006 04:39:10 +0000 (04:39 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 9 Jul 2006 04:39:10 +0000 (04:39 +0000)
need the full POSIX semantics (and weren't implementing them
anyway).

ChangeLog
data/c.m4

index 6ad089a4dd851089528552a1a535d83cf5fa912b..51e3a41e1ce323523d2b5322c9dc2ad59a530cd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-07-08  Paul Eggert  <eggert@cs.ucla.edu>
 
 2006-07-08  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * data/c.m4 (b4_basename): Simplify a bit, since we don't
+       need the full POSIX semantics (and weren't implementing them
+       anyway).
+
        Adjust to Autoconf 2.60 and today's gnulib.
        * bootstrap (gnulib_modules): Add stdint.
        Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
        Adjust to Autoconf 2.60 and today's gnulib.
        * bootstrap (gnulib_modules): Add stdint.
        Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
@@ -47,7 +51,7 @@
 
 2006-07-08  Akim Demaille  <akim@lrde.epita.fr>
 
 
 2006-07-08  Akim Demaille  <akim@lrde.epita.fr>
 
-       * data/c.m4 (b4_dirname): New.
+       * data/c.m4 (b4_basename): New.
        (b4_syncline): Also output the location of its invocation (from
        the skeleton).
        (b4_user_action, b4_define_user_action, b4_user_actions)
        (b4_syncline): Also output the location of its invocation (from
        the skeleton).
        (b4_user_action, b4_define_user_action, b4_user_actions)
index 33b4dddad656d671d1a68c03504aef15af8fa479..4e745c0a0ec2e96af42a571dfb031a8e5f0b0321 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -410,17 +410,16 @@ m4_define([b4_c_arg],
 
 # b4_basename(NAME)
 # -----------------
 
 # b4_basename(NAME)
 # -----------------
+# Similar to POSIX basename; the differences don't matter here.
 # Beware that NAME is not evaluated.
 m4_define([b4_basename],
 # 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_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])])
 
 [/* Line __line__ of b4_basename(m4_quote(__file__)).  */
 [#]line $1 $2])])