X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/blobdiff_plain/db5fb322a04cdb13328247938ec14bbf85fba338..3016db029e1815d651db2e335eee94c165355449:/new_loba.sh?ds=sidebyside diff --git a/new_loba.sh b/new_loba.sh index 7519afc..506d38a 100755 --- a/new_loba.sh +++ b/new_loba.sh @@ -25,7 +25,7 @@ EOF fi name=$(echo $1 | tr A-Z a-z) -if ! echo "$name" | grep -q '^[a-z][a-z0-9_]*$' \ +if ! echo "$name" | grep -q '^[a-z0-9_]\+$' \ || ! [ $(echo "$name" | wc -l) = 1 ]; then echo "ERROR: invalid name -- \"$name\"" >&2 exit 1 @@ -125,8 +125,9 @@ nol_insert && $1 ~ /\}/ { } nol_insert && !nol_inserted && /NOL_INSERT/ { - if ($1 > nol_compare) { - print nol_string; + if ($1 >= nol_compare) { + if ($1 > nol_compare) + print nol_string; nol_inserted = 1; } } @@ -152,5 +153,5 @@ Check for differences, update algorithm description in "options.cpp", write your code in "${cpp_file}", and do not forget to add new files in SCM repository, for example with: \$ git add options.cpp ${h_file} ${cpp_file} - \$ git commit -m 'Add algorithm ${name}." + \$ git commit -m 'Add algorithm ${name}.' EOF