[libcamera-devel,0/2] libcamera: file: Don't parse directories
mbox series

Message ID 20201222135849.38052-1-kieran.bingham@ideasonboard.com
Headers show
Series
  • libcamera: file: Don't parse directories
Related show

Message

Kieran Bingham Dec. 22, 2020, 1:58 p.m. UTC
During development, and checking that the file I needed existed, I hit a
fault where the path was inadvertantly pointing to a directory.

The call to File::exists() then succeeded, and the code attempted to
parse a directory as if it were a file, with expectedly undesireable
results.

Add a test to ensure that File::exists does not return true when given a
directory and fix the underlying issue.

Kieran Bingham (2):
  test: file: Check that directories are not treated as files
  libcamera: file: Check files exist()

 src/libcamera/file.cpp | 3 ++-
 test/file.cpp          | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)