aboutsummaryrefslogtreecommitdiffstats
path: root/asn1c/asn1c.c
diff options
context:
space:
mode:
authorLev Walkin <vlm@lionet.info>2004-08-13 16:58:19 +0000
committerLev Walkin <vlm@lionet.info>2004-08-13 16:58:19 +0000
commit79f5495aaa51627e231c146665b28dfb42e3c13c (patch)
treebc35b7bc6a9890274b23f1cde400877bd0f9eeb5 /asn1c/asn1c.c
parent0ce0fd7bb4bd6127452fd213b1e2d2105ae103ea (diff)
custom basename(3) and dirname(3)
Diffstat (limited to 'asn1c/asn1c.c')
-rw-r--r--asn1c/asn1c.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/asn1c/asn1c.c b/asn1c/asn1c.c
index 086b4caf..0fd40dbc 100644
--- a/asn1c/asn1c.c
+++ b/asn1c/asn1c.c
@@ -8,7 +8,6 @@
#include <sys/types.h>
#include <sys/stat.h> /* for stat(2) */
#include <unistd.h>
-#include <libgen.h> /* for basename(3) */
#include <sysexits.h> /* for EX_USAGE */
#include <assert.h>
#include <errno.h>
@@ -18,6 +17,8 @@
#include <asn1print.h> /* Print the ASN.1 tree */
#include <asn1compiler.h> /* Compile the ASN.1 tree */
+#include <asn1c_compat.h> /* Portable basename(3) and dirname(3) */
+
static void usage(char *av0); /* Print the Usage screen and exit(EX_USAGE) */
int
@@ -118,7 +119,7 @@ main(int ac, char **av) {
av += optind;
} else {
fprintf(stderr, "%s: No input files specified\n",
- basename(av[0]));
+ a1c_basename(av[0]));
exit(1);
}
@@ -201,7 +202,7 @@ main(int ac, char **av) {
char *p;
int len;
- p = dirname(av[-optind]);
+ p = a1c_dirname(av[-optind]);
len = strlen(p) + sizeof("/../skeletons");
skeletons_dir = alloca(len);
@@ -261,7 +262,7 @@ usage(char *av0) {
"\t-Wdebug-fixer\tDebug ASN.1 semantics processor\n"
"\t-Wdebug-compiler\tDebug ASN.1 compiler\n"
,
- basename(av0), DATADIR
+ a1c_basename(av0), DATADIR
);
exit(EX_USAGE);
}