libtool-patches
[Top][All Lists]
Advanced

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

Re: FYI: function definitions


From: Ralf Wildenhues
Subject: Re: FYI: function definitions
Date: Wed, 2 Feb 2005 13:17:36 +0100
User-agent: Mutt/1.4.1i

* Gary V. Vaughan wrote on Tue, Feb 01, 2005 at 02:41:59PM CET:
> Ralf Wildenhues wrote:
> > * Gary V. Vaughan wrote on Tue, Feb 01, 2005 at 12:49:29PM CET: 
> > > On branch-2-0, I think the following is fairly future proof:
> > >
> > > test -n "$as_cr_alnum" || as_cr_alnum='abcdef...XYZ0123456789'
> > >
> > > In both cases, I think the slight untidiness is worth the extra safety 
> > > added
> > > to sh.test...  what do you think?
> > 
*snip*
> In any case, I think adding the extra check to sh.test would be a good
> thing -- however the expression is constructed.

Applied the following change to HEAD and branch-2-0.  Left out all of
the alnum stuff -- the shell's parser will take care of this when
executing the script.  :-)

Regards,
Ralf

2005-02-02  Ralf Wildenhues  <address@hidden>

        * tests/sh.test: Check for preferred function definition layout.

Index: tests/sh.test
===================================================================
RCS file: /cvsroot/libtool/libtool/tests/sh.test,v
retrieving revision 1.19.2.4
diff -u -r1.19.2.4 sh.test
--- tests/sh.test       31 Jan 2005 17:31:30 -0000      1.19.2.4
+++ tests/sh.test       2 Feb 2005 12:14:33 -0000
@@ -91,4 +91,18 @@
   fi
 done
 
+# Check for opening brace on next line in shell function definition.
+for s in $scripts
+do
+  if $SED -n '/^func_/{N;/^func_[^     ]* ()\n{$/d;p;}' "$s" |
+     $EGREP .; then
+    echo "Function definitions should look like this in $s:
+func_foo ()
+{
+  # ...
+}"
+    status=$EXIT_FAILURE
+  fi
+done
+
 exit $status




reply via email to

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