OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #if SK_BUILD_FOR_MAC || SK_BUILD_FOR_UNIX || SK_BUILD_FOR_ANDROID | 8 #if SK_BUILD_FOR_MAC || SK_BUILD_FOR_UNIX || SK_BUILD_FOR_ANDROID |
9 # include <unistd.h> | 9 # include <unistd.h> |
10 # include <sys/time.h> | 10 # include <sys/time.h> |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (!sk_isdir(joinedPath.c_str())) { | 123 if (!sk_isdir(joinedPath.c_str())) { |
124 entries->push_back(SkString(entry->d_name)); | 124 entries->push_back(SkString(entry->d_name)); |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 closedir(dir); | 128 closedir(dir); |
129 | 129 |
130 return true; | 130 return true; |
131 #elif SK_BUILD_FOR_WIN32 | 131 #elif SK_BUILD_FOR_WIN32 |
132 char pathDirGlob[MAX_PATH]; | 132 char pathDirGlob[MAX_PATH]; |
133 char pathLength = strlen(path); | 133 size_t pathLength = strlen(path); |
134 strncpy(pathDirGlob, path, pathLength); | 134 strncpy(pathDirGlob, path, pathLength); |
135 | 135 |
136 if (path[pathLength - 1] == '/' || path[pathLength - 1] == '\\') { | 136 if (path[pathLength - 1] == '/' || path[pathLength - 1] == '\\') { |
137 SkASSERT(pathLength + 2 <= MAX_PATH); | 137 SkASSERT(pathLength + 2 <= MAX_PATH); |
138 pathDirGlob[pathLength] = '*'; | 138 pathDirGlob[pathLength] = '*'; |
139 pathDirGlob[pathLength + 1] = '\0'; | 139 pathDirGlob[pathLength + 1] = '\0'; |
140 } else { | 140 } else { |
141 SkASSERT(pathLength + 3 <= MAX_PATH); | 141 SkASSERT(pathLength + 3 <= MAX_PATH); |
142 pathDirGlob[pathLength] = '\\'; | 142 pathDirGlob[pathLength] = '\\'; |
143 pathDirGlob[pathLength + 1] = '*'; | 143 pathDirGlob[pathLength + 1] = '*'; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 #elif SK_BUILD_FOR_WIN32 | 197 #elif SK_BUILD_FOR_WIN32 |
198 SkString fullPath(MAX_PATH); | 198 SkString fullPath(MAX_PATH); |
199 if (_fullpath(fullPath.writable_str(), path.c_str(), MAX_PATH) == NULL) { | 199 if (_fullpath(fullPath.writable_str(), path.c_str(), MAX_PATH) == NULL) { |
200 fullPath.reset(); | 200 fullPath.reset(); |
201 } | 201 } |
202 return fullPath; | 202 return fullPath; |
203 #else | 203 #else |
204 return SkString(); | 204 return SkString(); |
205 #endif | 205 #endif |
206 } | 206 } |
OLD | NEW |