Skip to content
Snippets Groups Projects
  • Nadav Har'El's avatar
    0b9ec899
    bootfs: fix bug with wildcard (**) entries · 0b9ec899
    Nadav Har'El authored
    mkbootfs.py supports wildcard entries, looking like:
    /jetty/**: ../../../tmp/jetty/**
    
    The name of the generated files in the bootfs looked like this:
                    name + relpath + '/' + filename
    
    where "name" is "/jetty/", relpath is the directory under it
    (so for /jetty/foo/bar/yo, relpath is "foo/bar") and filename
    is the file name (in this example "yo"). The problem is that
    when relpath=="", i.e., files directly under /jetty, an extra
    slash was generated - e.g., /jetty//something. When this extra
    slash was written to the filesystem it confused readdir(),
    causing it to return twice for each file (once with an empty
    filename, and a second time with the real filename).
    
    This patch avoid the extra slash when relpath is empty.
    0b9ec899
    History
    bootfs: fix bug with wildcard (**) entries
    Nadav Har'El authored
    mkbootfs.py supports wildcard entries, looking like:
    /jetty/**: ../../../tmp/jetty/**
    
    The name of the generated files in the bootfs looked like this:
                    name + relpath + '/' + filename
    
    where "name" is "/jetty/", relpath is the directory under it
    (so for /jetty/foo/bar/yo, relpath is "foo/bar") and filename
    is the file name (in this example "yo"). The problem is that
    when relpath=="", i.e., files directly under /jetty, an extra
    slash was generated - e.g., /jetty//something. When this extra
    slash was written to the filesystem it confused readdir(),
    causing it to return twice for each file (once with an empty
    filename, and a second time with the real filename).
    
    This patch avoid the extra slash when relpath is empty.