Issue 10: fix bug wrt s3fox folders

git-svn-id: http://s3fs.googlecode.com/svn/trunk@37 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
rrizun 2008-01-21 19:44:20 +00:00
parent 56915cdf88
commit 59f95c7d57

View File

@ -368,8 +368,9 @@ s3fs_getattr(const char *path, struct stat *stbuf) {
if (curl_easy_getinfo(curl, CURLINFO_FILETIME, &LastModified) == 0)
stbuf->st_mtime = LastModified;
char* ContentType;
if (curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ContentType) == 0)
char* ContentType = 0;
stbuf->st_mode = S_IFREG|0755;
if (curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ContentType) == 0 && ContentType)
stbuf->st_mode = strcmp(ContentType, "application/x-directory")== 0 ? S_IFDIR | 0755 : S_IFREG | 0755;
double ContentLength;