From 934f8bc2fd901ded1bb8003f9d56f583e182bb40 Mon Sep 17 00:00:00 2001 From: Philippe Marzouk Date: Sun, 9 Sep 2001 08:49:24 +0000 Subject: [PATCH] patch from Keith Wall to allow a get without a previous ls in shell mode git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2211 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/canon/canon.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/camlibs/canon/canon.c b/camlibs/canon/canon.c index 761fe9118..d84669fd9 100644 --- a/camlibs/canon/canon.c +++ b/camlibs/canon/canon.c @@ -717,6 +717,12 @@ int camera_file_get (Camera *camera, const char *folder, const char *filename, strcpy(path, cs->cached_drive); + /* update file cache (if necessary) first */ + if(!update_dir_cache(camera)) { + gp_frontend_status(NULL, _("Could not obtain directory listing")); + return GP_ERROR; + } + if (get_file_path(camera, filename,path) == GP_ERROR) { gp_debug_printf(GP_DEBUG_LOW,"canon","Filename not found!\n"); return GP_ERROR; @@ -1462,6 +1468,7 @@ int camera_init(Camera *camera) cs->cached_disk = 0; cs->cached_dir = 0; cs->dump_packets = 0; + cs->cached_tree = NULL; fprintf(stderr,"canon_initialize()\n");