< prev index next >

src/java.base/share/native/libzip/zip_util.c

Print this page




1189                     ZIP_Unlock(zip);
1190                     ZIP_FreeEntry(zip, ze);
1191                     ZIP_Lock(zip);
1192                 }
1193                 ze = 0;
1194             }
1195             idx = zc->next;
1196         }
1197 
1198         /* Entry found, return it */
1199         if (ze != 0) {
1200             break;
1201         }
1202 
1203         /* If no need to try appending slash, we are done */
1204         if (!addSlash) {
1205             break;
1206         }
1207 
1208         /* Slash is already there? */
1209         if (name[ulen-1] == '/') {
1210             break;
1211         }
1212 
1213         /* Add slash and try once more */
1214         name[ulen++] = '/';
1215         name[ulen] = '\0';
1216         hsh = hash_append(hsh, '/');
1217         idx = zip->table[hsh % zip->tablelen];
1218         addSlash = JNI_FALSE;
1219     }
1220 
1221 Finally:
1222     ZIP_Unlock(zip);
1223     return ze;
1224 }
1225 
1226 /*
1227  * Returns the n'th (starting at zero) zip file entry, or NULL if the
1228  * specified index was out of range.
1229  */




1189                     ZIP_Unlock(zip);
1190                     ZIP_FreeEntry(zip, ze);
1191                     ZIP_Lock(zip);
1192                 }
1193                 ze = 0;
1194             }
1195             idx = zc->next;
1196         }
1197 
1198         /* Entry found, return it */
1199         if (ze != 0) {
1200             break;
1201         }
1202 
1203         /* If no need to try appending slash, we are done */
1204         if (!addSlash) {
1205             break;
1206         }
1207 
1208         /* Slash is already there? */
1209         if (ulen > 0 && name[ulen - 1] == '/') {
1210             break;
1211         }
1212 
1213         /* Add slash and try once more */
1214         name[ulen++] = '/';
1215         name[ulen] = '\0';
1216         hsh = hash_append(hsh, '/');
1217         idx = zip->table[hsh % zip->tablelen];
1218         addSlash = JNI_FALSE;
1219     }
1220 
1221 Finally:
1222     ZIP_Unlock(zip);
1223     return ze;
1224 }
1225 
1226 /*
1227  * Returns the n'th (starting at zero) zip file entry, or NULL if the
1228  * specified index was out of range.
1229  */


< prev index next >