/usr/share/gnudatalanguage/astrolib/nulltrim.pro is in gdl-astrolib 2018.02.16+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | function nulltrim,st
;+
; NAME:
; NULLTRIM
; PURPOSE:
; Trim a string of all characters after and including the first null
; EXPLANATION:
; The null character is an ascii 0b
;
; CALLING SEQUENCE:
; result = nulltrim( st )
;
; INPUTS:
; st = input string
; OUTPUTS:
; trimmed string returned as the function value.
; HISTORY:
; D. Lindler July, 1987
; Converted to IDL V5.0 W. Landsman September 1997
;-
;--------------------------------------------------------------------
;
b = byte(st)
null = where( b eq 0, nfound )
if nfound lt 1 then return, st else return, strmid( st,0,null[0] )
end
|