title: fnamemodify filename list obtained from vim globpath giving error inside while loop
body: <p>I am trying to get the root file name from a <code>globpath()</code> in <code>viml</code>. 
  With satting dir and fnm name previously, I have:</p>
  
  <pre><code>  echo dir
    echo fnm
    echo fnamemodify(globpath(dir, fnm), ':r:t')
  </code></pre>
  
  <p>which is giving </p>
  
  <pre><code>/Devel/IO_EOS/objs
  *.mod
  Devel/IO_EOS/objs/constants.mod
  Devel/IO_EOS/objs/mpublic.mod
  Devel/IO_EOS/objs/mutil
  </code></pre>
  
  <p>i.e. extension is tripped from the last file only (<code>mutil</code>, which is also named as <code>mutil.mod</code>)</p>
  
  <p>So, I tried to split the files into list and trip the extension and path as:</p>
  
  <pre><code>  let files = filter(split(globpath(dir, fnm), '\n'), '!isdirectory(v:val)')
    echo files len(files)
    let c = 1
    while c &lt;= len(files))
      files[c] = fnamemodify(files[c]), ':r:t')
      let c += 1
    endwhile
  </code></pre>
  
  <p>Now, the files are the list of those file, and properly as a list, the while is not working.
  The error quoted is:</p>
  
  <pre><code>list index out of range: 3 
  invalid arguments for function fnamemodify(files[c]), ':r:t')
  invalid expression: fnamemodify(files[c]), ':r:t')
  </code></pre>
  
  <p>Kindly help.
  NB: the title became bit complex as somehow SO was not happy with shorter title. sorry for that.</p>