strcpy(buff, base); 
strncpy(buff, base, sizeof(buff)-1); 
char **expand_archive_names(int *nfiles_in_out, char **files){    int i, nfiles, arc_type;    char *infile_name;    char *base, *pattern, *p, buff[BUFSIZ];    char *one_file[1];    int one;    ArchiveFileList *afl;    /* Recusive global */    static MBlockList *pool;    static StringTable stab;    static int error_flag = 0;    static int depth = 0;    if(depth == 0)    {	error_flag = 0;	init_string_table(&stab);	pool = &arc_buffer;    }    nfiles = *nfiles_in_out;    for(i = 0; i < nfiles; i++)    {	infile_name = url_expand_home_dir(files[i]);	if((p = strrchr(infile_name, '#')) == NULL)	{	    base = infile_name;	    pattern = "*";	}	else	{	    int len = p - infile_name;	    base = new_segment(pool, len + 1); /* +1 for '\0' */	    memcpy(base, infile_name, len);	    base[len] = '\0';	    pattern = p + 1;	}	if((afl = find_arc_filelist(base)) != NULL)	{	    if(arc_expand_newfile(&stab, afl, pattern) == -1)		goto abort_expand;	    continue;	}	arc_type = get_archive_type(base);	if(arc_type == -1)	{	    if(put_string_table(&stab, infile_name, strlen(infile_name))	       == NULL)		goto abort_expand;	    continue;	}#ifdef SUPPORT_SOCKET	if(arc_type == ARCHIVE_NEWSGROUP)	{	    URL url;	    int len1, len2;	    char *news_prefix;	    if((url = url_newsgroup_open(base)) == NULL)	    {		arc_cant_open(base);		continue;	    }	    strcpy(buff, base);	    p = strchr(buff + 7, '/') + 1; /* news://..../ */	    *p = '\0';	    news_prefix = strdup_mblock(pool, buff);	    len1 = strlen(news_prefix);	    while(url_gets(url, buff, sizeof(buff)))	    {		len2 = strlen(buff);		p = (char *)new_segment(pool, len1 + len2 + 1);		strcpy(p, news_prefix);		strcpy(p + len1, buff);		one_file[0] = p;		one = 1;		depth++;		expand_archive_names(&one, one_file);		depth--;	    }	    url_close(url);	    if(error_flag)		goto abort_expand;	    continue;	}#endif /* SUPPORT_SOCKET */	if(arc_type == ARCHIVE_DIR)	{	    URL url;	    int len1, len2;	    if((url = url_dir_open(base)) == NULL)	    {		arc_cant_open(base);		continue;	    }	    if(strncmp(base, "dir:", 4) == 0)		base += 4;	    len1 = strlen(base);	    if(IS_PATH_SEP(base[len1 - 1]))		len1--;	    while(url_gets(url, buff, sizeof(buff)))	    {		if(strcmp(buff, ".") == 0 || strcmp(buff, "..") == 0)		    continue;		len2 = strlen(buff);		p = (char *)new_segment(pool, len1 + len2 + 2);		strcpy(p, base);		p[len1] = PATH_SEP;		strcpy(p + len1 + 1, buff);		one_file[0] = p;		one = 1;		depth++;		expand_archive_names(&one, one_file);		depth--;	    }	    url_close(url);	    if(error_flag)		goto abort_expand;	    continue;	}	if((afl = add_arc_filelist(base, arc_type)) != NULL)	{	    if(arc_expand_newfile(&stab, afl, pattern) == -1)		goto abort_expand;	}    }    if(depth)	return NULL;    *nfiles_in_out = stab.nstring;    reuse_mblock(pool);    return make_string_array(&stab); /* It is possible NULL */  abort_expand:    error_flag = 1;    if(depth)	return NULL;    delete_string_table(&stab);    free_global_mblock();    *nfiles_in_out = 0;    return NULL;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/361cc5df1e14516b0a3eef7766539860da9a9721/arc.c/clean/libarc/arc.c