while(name[0] == '/') name++;	/* skip '/'s right after # */ 
while(*name == '/') name++;	/* skip '/'s right after # (slash is always processed) */ #if PATH_SEP != '/' while(*name == PATH_SEP) name++;	/* skip PATH_SEPs */ #endif #if defined(PATH_SEP2) && (PATH_SEP2 != '/') while(*name == PATH_SEP2) name++;	/* skip PATH_SEP2s */ #endif 
URL url_arc_open(char *name){    URL_arc *url;    char *base, *p;    int len;    ArchiveFileList *afl;    ArchiveEntryNode *entry;    URL instream;    if((p = strrchr(name, '#')) == NULL)	return NULL;    len = p - name;    base = new_segment(&arc_buffer, len + 1);    memcpy(base, name, len);    base[len] = '\0';    base = url_expand_home_dir(base);    if((afl = find_arc_filelist(base)) == NULL)	afl = regist_archive(base);    if(afl == NULL)	return NULL;    reuse_mblock(&arc_buffer);	/* free `base' */    name += len + 1;    while(name[0] == '/') name++;	/* skip '/'s right after # */    for(entry = afl->entry_list; entry; entry = entry->next)    {	if(strcasecmp(entry->name, name) == 0)	    break;    }    if(entry == NULL)	return NULL;    if(entry->cache != NULL)	instream = url_mem_open((char *)entry->cache + entry->start,				entry->compsize, 0);    else    {	if((instream = url_file_open(base)) == NULL)	    return NULL;	url_seek(instream, entry->start, 0);    }    url = (URL_arc *)alloc_url(sizeof(URL_arc));    if(url == NULL)    {	url_errno = errno;	return NULL;    }    /* open decoder */    switch(entry->comptype)    {      case ARCHIVEC_STORED:	/* No compression */      case ARCHIVEC_LZHED_LH0:	/* -lh0- */      case ARCHIVEC_LZHED_LZ4:	/* -lz4- */	url->decoder = NULL;      case ARCHIVEC_DEFLATED:	/* deflate */	url->decoder =	    (void *)open_inflate_handler(archiver_read_func, url);	if(url->decoder == NULL)	{	    url_arc_close((URL)url);	    return NULL;	}	break;      case ARCHIVEC_IMPLODED_LIT8:      case ARCHIVEC_IMPLODED_LIT4:      case ARCHIVEC_IMPLODED_NOLIT8:      case ARCHIVEC_IMPLODED_NOLIT4:	url->decoder =	    (void *)open_explode_handler(archiver_read_func,					 entry->comptype - ARCHIVEC_IMPLODED - 1,					 entry->compsize, entry->origsize, url);	if(url->decoder == NULL)	{	    url_arc_close((URL)url);	    return NULL;	}	break;      case ARCHIVEC_LZHED_LH1:	/* -lh1- */      case ARCHIVEC_LZHED_LH2:	/* -lh2- */      case ARCHIVEC_LZHED_LH3:	/* -lh3- */      case ARCHIVEC_LZHED_LH4:	/* -lh4- */      case ARCHIVEC_LZHED_LH5:	/* -lh5- */      case ARCHIVEC_LZHED_LZS:	/* -lzs- */      case ARCHIVEC_LZHED_LZ5:	/* -lz5- */      case ARCHIVEC_LZHED_LHD:	/* -lhd- */      case ARCHIVEC_LZHED_LH6:	/* -lh6- */      case ARCHIVEC_LZHED_LH7:	/* -lh7- */	url->decoder =	    (void *)open_unlzh_handler(				       archiver_read_func,				       lzh_methods[entry->comptype - ARCHIVEC_LZHED - 1],				       entry->compsize, entry->origsize, url);	if(url->decoder == NULL)	{	    url_arc_close((URL)url);	    return NULL;	}	break;      default:	url_arc_close((URL)url);	return NULL;    }    /* common members */    URLm(url, type)      = URL_arc_t;    URLm(url, url_read)  = url_arc_read;    URLm(url, url_gets)  = NULL;    URLm(url, url_fgetc) = NULL;    URLm(url, url_seek)  = NULL;    URLm(url, url_tell)  = url_arc_tell;    URLm(url, url_close) = url_arc_close;    /* private members */    url->instream = instream;    url->pos = 0;    url->size = entry->origsize;    url->comptype = entry->comptype;    return (URL)url;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/a368f95b07e63bc497467610aa1a8422aa63e8e0/arc.c/clean/libarc/arc.c