Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
ebeb4015
Commit
ebeb4015
authored
Oct 09, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more portable get_param
parent
121ad662
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
tests/tests-randomized/check-bundles.sh
tests/tests-randomized/check-bundles.sh
+8
-3
No files found.
tests/tests-randomized/check-bundles.sh
View file @
ebeb4015
...
...
@@ -110,10 +110,15 @@ Make() {
get_param
()
{
param
=
"
$1
"
default
=
"
$2
"
text
=
"
$3
"
asn
=
"
$3
"
if
nawk
''
>
/dev/null 2>&1
;
then
AWK
=
nawk
else
AWK
=
awk
fi
echo
"
$asn
"
|
awk
"
/
$param
=/{for(i=1;i<=NF;i++)if(substr(
\$
i,0,length(
\"
${
param
}
=
\"
))==
\"
${
param
}
=
\"
)PARAM=substr(
\$
i,length(
\"
${
param
}
=
\"
)+1)}END{if(PARAM)print PARAM;else print
\"
${
default
}
\"
;}"
echo
"
$asn
"
|
${
AWK
}
"BEGIN{FS=
\"
[^
${
param
}
=0-9]+
\"
};
/
$param
=/{for(i=1;i<=NF;i++)if(substr(
\$
i,0,length(
\"
${
param
}
=
\"
))==
\"
${
param
}
=
\"
)PARAM=substr(
\$
i,length(
\"
${
param
}
=
\"
)+1)}END{if(PARAM)print PARAM;else print
\"
${
default
}
\"
;}"
}
# compile_and_test "<text>" "<where found>"
...
...
@@ -210,7 +215,7 @@ asn_compile() {
where
=
"
$2
"
# Create "INTEGER (1..2)" from "T ::= INTEGER (1..2) -- RMAX=5"
short_asn
=
`
echo
"
$asn
"
|
sed
-e
's/ *--.*//;s/RMAX=[
^ ]*
//;'
`
short_asn
=
`
echo
"
$asn
"
|
sed
-e
's/ *--.*//;s/RMAX=[
0-9]
//;'
`
if
[
`
echo
"
$short_asn
"
|
grep
-c
"::="
`
=
1
]
;
then
short_asn
=
`
echo
"
$short_asn
"
|
sed
-e
's/.*::= *//'
`
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment