diff options
author | Yang Tse <yangsita@gmail.com> | 2013-01-03 12:40:55 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2013-01-03 19:24:00 +0100 |
commit | 0b3180b4f53d8f101974d5f039a21f0529c15601 (patch) | |
tree | 1d5de8aceadba807c742e2d3da038c59c91c3c7f /lib/objnames.inc | |
parent | 8f13e3ddb98563db8e3965c894b2ad948e30b9e3 (diff) | |
download | curl-0b3180b4f53d8f101974d5f039a21f0529c15601.tar.gz |
test 1222: 8 chars object name generation && test 1221: adjustments
Diffstat (limited to 'lib/objnames.inc')
-rw-r--r-- | lib/objnames.inc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/objnames.inc b/lib/objnames.inc index 2ec8915b3..8778492b4 100644 --- a/lib/objnames.inc +++ b/lib/objnames.inc @@ -82,4 +82,26 @@ curl_10char_object_name() { -e 's:^\(..........\).*:\1:' } +# +# curl_8char_object_name +# +# Same as curl_10char_object_name() description and details above, except +# that object name is limited to 8 charcters maximum. +# + +curl_8char_object_name() { + echo "${1}" | \ + sed -e 's:.*/::' \ + -e 's:[.].*::' \ + -e 'y:abcdefghijklmnopqrstuvwxyz:ABCDEFGHIJKLMNOPQRSTUVWXYZ:' \ + -e 's:[^ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_]:_:g' \ + -e 's:__*:_:g' \ + -e 's:\([^_]\)[^_]*_\(.*\):\1\2:' \ + -e 's:\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3:' \ + -e 's:\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3\4:' \ + -e 's:\([^_]\)\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3\4\5:' \ + -e 's:\([^_]\)\([^_]\)\([^_]\)\([^_]\)\([^_]\)[^_]*_\(.*\):\1\2\3\4\5\6:' \ + -e 's:^\(........\).*:\1:' +} + # end of objectname.inc |