diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /pkg/utilities/nttools/stxtools/strjust.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'pkg/utilities/nttools/stxtools/strjust.x')
-rw-r--r-- | pkg/utilities/nttools/stxtools/strjust.x | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/pkg/utilities/nttools/stxtools/strjust.x b/pkg/utilities/nttools/stxtools/strjust.x new file mode 100644 index 00000000..5f50f080 --- /dev/null +++ b/pkg/utilities/nttools/stxtools/strjust.x @@ -0,0 +1,31 @@ +include <ctype.h> + +# STRJUST -- Remove whitspace from a string and convert to lower case +# +# B.Simon 30-Jan-95 copied from synphot$strfix + +procedure strjust (str) + +char str[ARB] # u: string to convert +#-- +int ic, jc + +begin + jc = 1 + for (ic = 1; str[ic] != EOS; ic = ic + 1) { + if (IS_WHITE(str[ic])) + next + + if (IS_UPPER(str[ic])) { + str[jc] = TO_LOWER(str[ic]) + + } else if (jc < ic) { + str[jc] = str[ic] + } + + jc = jc + 1 + } + + str[jc] = EOS +end + |