summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/xmlstarlet/files/0001-usage2c.awk-fix-wrong-basename-regexp.patch
blob: 24b187f2ac9950481f5c48c3157b9adc0aa9d8c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Upstream-Status: Submitted [sourceforge]

From 75d789d0ea9716c9a9ae72f42a2fcfa907cf4a12 Mon Sep 17 00:00:00 2001
From: Matthieu Crapet <mcrapet@gmail.com>
Date: Mon, 30 Jun 2014 13:52:25 +0200
Subject: [PATCH] usage2c.awk: fix wrong basename regexp

Previously not matching with filename argument with absolute path.

Signed-off-by: Matthieu Crapet <mcrapet@gmail.com>
---
 usage2c.awk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usage2c.awk b/usage2c.awk
index 94b897a..9aea212 100755
--- a/usage2c.awk
+++ b/usage2c.awk
@@ -6,13 +6,13 @@ BEGIN {
 }
 
 # text in src/foo-bar.txt results in
-#   static const char foo_text[] = {
+#   static const char foo_bar[] = {
 #     't', 'h', 'e', ' ', 't', 'e', 'x', 't', ...
 #   }
 length(command_name) == 0 {
     command_name = FILENAME;
     sub(/\.txt$/, "", command_name);
-    sub(/^([^\/]+\/)*/, "", command_name);
+    sub(/^.*\//, "", command_name);
     gsub(/-/, "_", command_name);
     printf("static const char %s[] = {\n", command_name);
     progs = 0;
-- 
2.0.0