Skip to content

Commit 2e00ccc

Browse files
author
Giloo
committed
should work on .dlm that start with blank lines, too
1 parent 76b86c0 commit 2e00ccc

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/pro/utilities/dlm_register.pro

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,13 @@ end
4141
; silent is a GDL extension
4242
pro dlm_register,filein,silent=silent,verbose=verbose
4343
COMPILE_OPT idl2, HIDDEN
44-
if n_elements(filein) eq 0 then begin; default search is also the local directory
44+
if n_elements(filein) eq 0 then begin ; default search is also the local directory
4545
searchpath="."+ PATH_SEP(/SEARCH_PATH) +!DLM_PATH
46-
filelist=file_search(STRSPLIT(searchpath, PATH_SEP(/SEARCH_PATH),/extract)+'/*.dlm')
46+
filelist=file_search(STRSPLIT(searchpath, PATH_SEP(/SEARCH_PATH),/extract)+'/*.dlm')
47+
if n_elements(filelist) eq 1 and filelist[0] eq "" then return
4748
endif else filelist=filein
48-
nfiles = n_elements(filelist)
49-
if nfiles eq 1 and filelist[0] eq "" then begin
50-
if keyword_set(silent) then return
51-
Message,"Incorrect number of arguments."
52-
endif
53-
49+
50+
nfiles=n_elements(filelist)
5451

5552
case !version.os of
5653
"linux": ext=".so"
@@ -63,10 +60,9 @@ pro dlm_register,filein,silent=silent,verbose=verbose
6360
file=file_expand_path(file)
6461
sl=strlen(file)-4 ; .dlm
6562
image=strmid(file,0,sl)+ext
66-
if keyword_set(verbose) then print,'image: '+image & print
63+
if keyword_set(verbose) then print,'image: '+image & print
6764
s=gdl_get_dlm_info(file)
6865
n=n_elements(s)
69-
if s[0] eq "" then break
7066
; check if this is a GDL-native DLL
7167
findpos=strpos(s , "#%GDL_DLM")
7268
is_gdl = findpos[0] gt -1

0 commit comments

Comments
 (0)