change log for rtems (2010-07-30)
rtems-vc at rtems.org
rtems-vc at rtems.org
Fri Jul 30 12:10:46 UTC 2010
*ralf*:
2010-07-30 Ralf Corsépius <ralf.corsepius at rtems.org>
* configure.ac: Check for libgen.h, basename.
* rtems-bin2c.c: Use basename(3) instead of strrchr cascade.
Introduce ifbasename. Use ifbasename in generated files.
M 1.40 tools/build/ChangeLog
M 1.19 tools/build/configure.ac
M 1.7 tools/build/rtems-bin2c.c
diff -u rtems/tools/build/ChangeLog:1.39 rtems/tools/build/ChangeLog:1.40
--- rtems/tools/build/ChangeLog:1.39 Thu Jul 29 12:12:38 2010
+++ rtems/tools/build/ChangeLog Fri Jul 30 07:09:37 2010
@@ -1,3 +1,9 @@
+2010-07-30 Ralf Corsépius <ralf.corsepius at rtems.org>
+
+ * configure.ac: Check for libgen.h, basename.
+ * rtems-bin2c.c: Use basename(3) instead of strrchr cascade.
+ Introduce ifbasename. Use ifbasename in generated files.
+
2010-07-29 Ralf Corsépius <ralf.corsepius at rtems.org>
* rtems-bin2c.c: Add -C and -H options.
diff -u rtems/tools/build/configure.ac:1.18 rtems/tools/build/configure.ac:1.19
--- rtems/tools/build/configure.ac:1.18 Sat Dec 2 00:06:23 2006
+++ rtems/tools/build/configure.ac Fri Jul 30 07:09:37 2010
@@ -13,8 +13,8 @@
AM_MAINTAINER_MODE
AC_PROG_CC
-AC_CHECK_HEADERS([getopt.h])
-AC_CHECK_FUNCS(strerror strtol)
+AC_CHECK_HEADERS([getopt.h libgen.h])
+AC_CHECK_FUNCS(strerror strtol basename)
RTEMS_PATH_KSH
diff -u rtems/tools/build/rtems-bin2c.c:1.6 rtems/tools/build/rtems-bin2c.c:1.7
--- rtems/tools/build/rtems-bin2c.c:1.6 Thu Jul 29 12:12:38 2010
+++ rtems/tools/build/rtems-bin2c.c Fri Jul 30 07:09:38 2010
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <libgen.h>
#ifndef PATH_MAX
#define PATH_MAX 1024
@@ -111,15 +112,10 @@
}
/* find basename */
- if ((cp = strrchr(ifname, '/')) != NULL)
- ++cp;
- else {
- if ((cp = strrchr(ifname, '\\')) != NULL)
- ++cp;
- else
- cp = ifname;
- }
- strcpy(buf, cp);
+ char *ifbasename = strdup(ifname);
+ ifbasename = basename(ifbasename);
+
+ strcpy(buf, ifbasename);
for (p = buf; *p != '\0'; ++p)
if (!isalnum(*p))
*p = '_';
@@ -136,7 +132,7 @@
"\n"
"#include <sys/types.h>\n"
"\n",
- ifname
+ ifbasename
);
/* print structure */
@@ -190,7 +186,7 @@
"\n"
"#include <sys/types.h>\n"
"\n",
- obasename, /* header */
+ ifbasename, /* header */
obasename, /* ifndef */
obasename /* define */
);
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100730/8554399f/attachment.html>
More information about the vc
mailing list