From 84ec874ad53ce01c1d870dff802ce862eb163c66 Mon Sep 17 00:00:00 2001 From: Bo Ørsted Andresen Date: Tue, 23 Oct 2007 20:27:38 +0000 Subject: Use ¤ instead of % since the % is special in bash before 3.2. Revert r205 to stay compatible with bash 3.0 which has no support for +=. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wgetpaste | 74 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/wgetpaste b/wgetpaste index 7390f19..709ba86 100755 --- a/wgetpaste +++ b/wgetpaste @@ -15,11 +15,11 @@ SERVICES="ca rafb osl" # ca ENGINE_ca=ca URL_ca="http://pastebin.ca/" -SIZE_ca="1024000 1%MB" +SIZE_ca="1024000 1¤MB" # rafb ENGINE_rafb=rafb URL_rafb="http://rafb.net/paste/ paste.php" -SIZE_rafb="800000 800%kB" +SIZE_rafb="800000 800¤kB" LINES_rafb=10000 TOOFAST_rafb="http://rafb.net/p/toofast.html You must wait at least 10 seconds between each paste! Try again in 10 seconds." TOOBIG_rafb="http://rafb.net/p/toobig.html The paste is too big. Try another service or paste smaller chunks of data." @@ -33,36 +33,36 @@ URL_tinyurl="http://tinyurl.com/ create.php" ### engines # ca -LANGUAGES_ca="Plain%Text Asterisk%Configuration C C++ PHP Perl Java VB C# Ruby Python Pascal \ -mIRC PL/I XML SQL Scheme ActionScript Ada Apache%Configuration Assembly%(NASM) ASP Bash CSS \ -Delphi HTML%4.0%Strict JavaScript LISP Lua Microprocessor%ASM Objective%C VB.NET" +LANGUAGES_ca="Plain¤Text Asterisk¤Configuration C C++ PHP Perl Java VB C# Ruby Python Pascal \ +mIRC PL/I XML SQL Scheme ActionScript Ada Apache¤Configuration Assembly¤(NASM) ASP Bash CSS \ +Delphi HTML¤4.0¤Strict JavaScript LISP Lua Microprocessor¤ASM Objective¤C VB.NET" LANGUAGE_COUNT_ca=0 -EXPIRATIONS_ca="Never 5%minutes 10%minutes 15%minutes 30%minutes 45%minutes 1%hour 2%hours \ -4%hours 8%hours 12%hours 1%day 2%days 3%days 1%week 2%weeks 3%weeks 1%month 2%months \ -3%months 4%months 5%months 6%months 1%year" -POST_ca="s=Submit+Post name description type expiry % content" +EXPIRATIONS_ca="Never 5¤minutes 10¤minutes 15¤minutes 30¤minutes 45¤minutes 1¤hour 2¤hours \ +4¤hours 8¤hours 12¤hours 1¤day 2¤days 3¤days 1¤week 2¤weeks 3¤weeks 1¤month 2¤months \ +3¤months 4¤months 5¤months 6¤months 1¤year" +POST_ca="s=Submit+Post name description type expiry ¤ content" REGEX_URL_ca='s|^.*content="[0-9]\+;\(http://[^/]\+/[0-9]\+\)".*$|\1|p' REGEX_RAW_ca='s|^\(http://[^/]\+/\)\([0-9]\+\)$|\1raw/\2|' # rafb -LANGUAGES_rafb="C C89 C99 C++ C# Java Pascal Perl PHP PL/I Python Ruby SQL VB Plain%Text" -POST_rafb="% nick desc lang % cvt_tabs text" +LANGUAGES_rafb="C C89 C99 C++ C# Java Pascal Perl PHP PL/I Python Ruby SQL VB Plain¤Text" +POST_rafb="¤ nick desc lang ¤ cvt_tabs text" REGEX_RAW_rafb='s|html\?$|txt|' # osl -LANGUAGES_osl="Plain%Text ActionScript Ada Apache%Log%File AppleScript Assembly%(NASM) \ -ASP Bash C C%for%Macs CAD%DCL CAD%Lisp C++ C# ColdFusion CSS D Delphi Diff DOS Eiffel Fortran \ -FreeBasic Game%Maker HTML%4.0%Strict INI%file Java Javascript Lisp Lua MatLab Microprocessor%ASM \ -MySQL NullSoft%Installer Objective%C OCaml Openoffice.org%BASIC Oracle%8 Pascal Perl PHP Python \ +LANGUAGES_osl="Plain¤Text ActionScript Ada Apache¤Log¤File AppleScript Assembly¤(NASM) \ +ASP Bash C C¤for¤Macs CAD¤DCL CAD¤Lisp C++ C# ColdFusion CSS D Delphi Diff DOS Eiffel Fortran \ +FreeBasic Game¤Maker HTML¤4.0¤Strict INI¤file Java Javascript Lisp Lua MatLab Microprocessor¤ASM \ +MySQL NullSoft¤Installer Objective¤C OCaml Openoffice.org¤BASIC Oracle¤8 Pascal Perl PHP Python \ QBasic Robots.txt Ruby Scheme Smarty SQL TCL VB VB.NET VisualFoxPro XML" LANGUAGE_VALUES_osl="text actionscript ada apache applescript asm asp bash c c_mac caddcl \ cadlisp cpp csharp cfm css d delphi diff dos eiffel fortran freebasic gml html4strict ini java \ javascript lisp lua matlab mpasm mysql nsis objc ocaml oobas oracle8 pascal perl php python \ qbasic robots ruby scheme smarty sql tcl vb vbnet visualfoxpro xml" -EXPIRATIONS_osl="Never 1%day 1%month" +EXPIRATIONS_osl="Never 1¤day 1¤month" EXPIRATION_VALUES_osl="f d m" -POST_osl="paste=Send poster % format expiry % code2" +POST_osl="paste=Send poster ¤ format expiry ¤ code2" REGEX_RAW_osl='s|^\(http://[^/]\+/\)\([0-9]\+\)$|\1pastebin.php?dl=\2|' # tinyurl -POST_tinyurl="submit=Make+TinyURL! % % % % % url" +POST_tinyurl="submit=Make+TinyURL! ¤ ¤ ¤ ¤ ¤ url" REGEX_URL_tinyurl='s|^$|\1|p' ### errors @@ -130,13 +130,13 @@ verifylanguage() { if [[ -n ${!lang} ]]; then ((i=0)) for l in ${!lang}; do - if [[ $LANGUAGE == ${l//%/ } ]]; then + if [[ $LANGUAGE == ${l//¤/ } ]]; then if [[ -n ${!count} ]]; then ((LANGUAGE=i+1)) elif [[ -n ${!values} ]]; then ((j=0)) for v in ${!values}; do - [[ i -eq j ]] && LANGUAGE=${v//%/ } && break + [[ i -eq j ]] && LANGUAGE=${v//¤/ } && break ((j++)) done fi @@ -160,13 +160,13 @@ verifyexpiration() { if [[ -n ${!expiration} ]]; then ((i=0)) for e in ${!expiration}; do - if [[ ${EXPIRATION} == ${e//%/ } ]]; then + if [[ ${EXPIRATION} == ${e//¤/ } ]]; then if [[ -n ${!count} ]]; then ((EXPIRATION=i+1)) elif [[ -n {!values} ]]; then ((j=0)) for v in ${!values}; do - [[ i -eq j ]] && EXPIRATION=${e//%/ } && break + [[ i -eq j ]] && EXPIRATION=${e//¤/ } && break ((j++)) done fi @@ -214,7 +214,7 @@ getfilenames() { for f in "$@"; do [[ -f $f ]] || die "$0: $f No such file found." SOURCE="files" - FILES+=("$f") + FILES[${#FILES[*]}]="$f" done } @@ -297,8 +297,8 @@ showlanguages() { lang=LANGUAGES_$ENGINE [[ -z ${!lang} ]] && echo "$N\"$ENGINE\" has no support for setting language." >&2 for l in ${!lang}; do - [[ ${l//%/ } = $DEFAULT_LANGUAGE ]] && d="*" || d=" " - echo " $d${l//%/ }" + [[ ${l//¤/ } = $DEFAULT_LANGUAGE ]] && d="*" || d=" " + echo " $d${l//¤/ }" done | sort } @@ -309,8 +309,8 @@ showexpirations() { info=EXPIRATION_INFO_$SERVICE [[ -z ${!expiration} ]] && echo "$N${!info}\"$ENGINE\" has no support for setting expiration." >&2 for e in ${!expiration}; do - [[ ${e//%/ } = $DEFAULT_EXPIRATION ]] && d="*" || d=" " - echo " $d${e//%/ }" + [[ ${e//¤/ } = $DEFAULT_EXPIRATION ]] && d="*" || d=" " + echo " $d${e//¤/ }" done } @@ -354,13 +354,13 @@ postdata() { nr=${!post//[^ ]} [[ 6 = ${#nr} ]] || die "\"${SERVICE}\" is not supported by ${FUNCNAME}()." extra=${!post%% *} - [[ % = $extra ]] || echo -n "$extra&" + [[ '¤' = $extra ]] || echo -n "$extra&" e() { post="$1" shift while [[ -n $1 ]]; do f=${post%% *} - [[ % != $f ]] && echo -n "$f=${!1}" && [[ $# -gt 1 ]] && echo -n "&" + [[ '¤' != $f ]] && echo -n "$f=${!1}" && [[ $# -gt 1 ]] && echo -n "&" shift post=${post#$f } done @@ -388,7 +388,7 @@ while [[ -n $1 ]]; do case "$1" in -- ) for arg in "$@"; do - ARGS+=("$arg") + ARGS[${#ARGS[*]}]="$arg" done break ;; @@ -397,19 +397,19 @@ while [[ -n $1 ]]; do DEBUG=0 ;; --*=* ) - ARGS+=("${1%%=*}") - ARGS+=("${1#*=}") + ARGS[${#ARGS[*]}]="${1%%=*}" + ARGS[${#ARGS[*]}]="${1#*=}" ;; --* ) - ARGS+=("$1") + ARGS[${#ARGS[*]}]="$1" ;; -* ) for shortarg in $(sed 's|.| -&|g' <<< "${1#-}"); do - ARGS+=("$shortarg") + ARGS[${#ARGS[*]}]="$shortarg" done ;; * ) - ARGS+=("$1") + ARGS[${#ARGS[*]}]="$1" esac shift done @@ -426,7 +426,7 @@ while [[ -n $1 ]]; do -c | --command ) requiredarg "$@" SOURCE="command" - COMMANDS+=("$2") + COMMANDS[${#COMMANDS[*]}]="$2" ;; -d | --description ) requiredarg "$@" @@ -520,7 +520,7 @@ default="DEFAULT_NICK_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_NICK=${!defau default="DEFAULT_LANGUAGE_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_LANGUAGE=${!default} default="DEFAULT_EXPIRATION_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_EXPIRATION=${!default} NICK=${NICK:-$(escape "${DEFAULT_NICK}")} -[[ -z $SOURCE ]] && SOURCE="stdin" && FILES+=("/dev/stdin") +[[ -z $SOURCE ]] && SOURCE="stdin" && FILES[${#FILES[*]}]="/dev/stdin" CVT_TABS=No INFO_COMMAND="emerge --info" -- cgit v1.2.3