From f040561aa4259bea11eccbf2e0f5dcf410ca63c7 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 12 Jan 2006 15:51:04 +0000 Subject: [PATCH] Support longer pathnames. MTP device folks want to upload stuff like (letters replaced by x): /store_00010001/Xxxxxxxxx_Xxxxxxx-Xxxxxxxx_Xxxxxxxx_Xxxxxx-XXXX-xxXXX/XX-xxxxxxxxx_xxxxxxx-xxxx_xxxx_xxx_xxxxx_xxx_xxxx_xxx_xxxxxx_xxxxxxxx_xxxxxx-xxxxx.mp3 git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8477 67ed7778-7388-44ab-90cf-0a291f65f57c --- libgphoto2/gphoto2-filesys.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libgphoto2/gphoto2-filesys.c b/libgphoto2/gphoto2-filesys.c index abe5b7abc..03025cc2e 100644 --- a/libgphoto2/gphoto2-filesys.c +++ b/libgphoto2/gphoto2-filesys.c @@ -61,8 +61,12 @@ #define GP_MODULE "libgphoto2" +#ifndef PATH_MAX +# define PATH_MAX 4096 +#endif + typedef struct _CameraFilesystemFile { - char name [128]; + char name [256]; int info_dirty; CameraFileInfo info; struct _CameraFilesystemFile *lru_prev; @@ -76,7 +80,7 @@ typedef struct _CameraFilesystemFile { typedef struct { int count; - char name [128]; + char name [PATH_MAX]; int files_dirty; int folders_dirty; CameraFilesystemFile *file; @@ -560,7 +564,7 @@ gp_filesystem_folder_number (CameraFilesystem *fs, const char *folder, GPContext *context) { int x, y, len; - char buf[128]; + char buf[PATH_MAX]; CameraList *list; CHECK_NULL (fs && folder); @@ -914,7 +918,7 @@ gp_filesystem_list_folders (CameraFilesystem *fs, const char *folder, CameraList *list, GPContext *context) { int x, y, j, offset, count; - char buf[1024]; + char buf[PATH_MAX]; const char *name; unsigned int len;