diff options
Diffstat (limited to 'recipes-sota/asn1c/files/skeletons_dir_fix.patch')
| -rw-r--r-- | recipes-sota/asn1c/files/skeletons_dir_fix.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/recipes-sota/asn1c/files/skeletons_dir_fix.patch b/recipes-sota/asn1c/files/skeletons_dir_fix.patch new file mode 100644 index 0000000..f1caa2f --- /dev/null +++ b/recipes-sota/asn1c/files/skeletons_dir_fix.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | From 1a1c2c94f700cf0f4dc5dba863950b16477fdc6d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Laurent Bonnans <laurent.bonnans@here.com> | ||
| 3 | Date: Thu, 25 Jan 2018 09:49:41 +0100 | ||
| 4 | Subject: [PATCH] Patch the skeletons directory detection | ||
| 5 | |||
| 6 | Detect `share/asn1c` from `bin/` if it exists | ||
| 7 | --- | ||
| 8 | asn1c/asn1c.c | 9 ++++----- | ||
| 9 | 1 file changed, 4 insertions(+), 5 deletions(-) | ||
| 10 | |||
| 11 | diff --git a/asn1c/asn1c.c b/asn1c/asn1c.c | ||
| 12 | index eb1eff7c..dd9fc832 100644 | ||
| 13 | --- a/asn1c/asn1c.c | ||
| 14 | +++ b/asn1c/asn1c.c | ||
| 15 | @@ -226,22 +226,21 @@ main(int ac, char **av) { | ||
| 16 | if(skeletons_dir == NULL) { | ||
| 17 | struct stat sb; | ||
| 18 | skeletons_dir = DATADIR; | ||
| 19 | - if((av[-optind][0] == '.' || av[-optind][1] == '/') | ||
| 20 | - && stat(skeletons_dir, &sb)) { | ||
| 21 | + if(stat(skeletons_dir, &sb)) { | ||
| 22 | /* | ||
| 23 | * The default skeletons directory does not exist, | ||
| 24 | * compute it from my file name: | ||
| 25 | - * ./asn1c/asn1c -> ./skeletons | ||
| 26 | + * ./asn1c/asn1c -> ./share/asn1c | ||
| 27 | */ | ||
| 28 | char *p; | ||
| 29 | size_t len; | ||
| 30 | |||
| 31 | p = a1c_dirname(av[-optind]); | ||
| 32 | |||
| 33 | - len = strlen(p) + sizeof("/../skeletons"); | ||
| 34 | + len = strlen(p) + sizeof("/../share/asn1c"); | ||
| 35 | skeletons_dir = malloc(len); | ||
| 36 | assert(skeletons_dir); | ||
| 37 | - snprintf(skeletons_dir, len, "%s/../skeletons", p); | ||
| 38 | + snprintf(skeletons_dir, len, "%s/../share/asn1c", p); | ||
| 39 | if(stat(skeletons_dir, &sb)) { | ||
| 40 | fprintf(stderr, | ||
| 41 | "WARNING: skeletons are neither in " | ||
| 42 | -- | ||
| 43 | 2.15.1 | ||
| 44 | |||
