src/findlib/find_one.c
static FF_PKT *new_dir_ff_pkt(FF_PKT *ff_pkt)
{
   FF_PKT *dir_ff_pkt = (FF_PKT *)bmalloc(sizeof(FF_PKT));
   memcpy(dir_ff_pkt, ff_pkt, sizeof(FF_PKT));
   dir_ff_pkt->fname = bstrdup(ff_pkt->fname);
   dir_ff_pkt->link = bstrdup(ff_pkt->link);
   dir_ff_pkt->sys_fname = get_pool_memory(PM_FNAME);

   if (ff_pkt->strip_snap_path) {
      dir_ff_pkt->fname_save = get_pool_memory(PM_FNAME);
      dir_ff_pkt->link_save = get_pool_memory(PM_FNAME);
      pm_strcpy(dir_ff_pkt->fname_save, ff_pkt->fname_save);
      pm_strcpy(dir_ff_pkt->link_save, ff_pkt->link_save);

      // need its own "working" buffers, some pm_strcat or pm_strcopy
      // will realloc these ones, no need to copy the current values
      dir_ff_pkt->snap_top_fname = get_pool_memory(PM_FNAME);
      dir_ff_pkt->snap_fname = get_pool_memory(PM_FNAME);
   } else {
      dir_ff_pkt->fname_save = NULL;
      dir_ff_pkt->link_save = NULL;
   }

   dir_ff_pkt->included_files_list = NULL;
   dir_ff_pkt->excluded_files_list = NULL;
   dir_ff_pkt->excluded_paths_list = NULL;
   dir_ff_pkt->linkhash = NULL;
   dir_ff_pkt->ignoredir_fname = NULL;
   return dir_ff_pkt;
}
/*
 * Create a new directory Find File packet, but copy
 *   some of the essential info from the current packet.
 *   However, be careful to zero out the rest of the
 *   packet.
 */
Create a new directory Find File packet, but copy
some of the essential info from the current packet.
However, be careful to zero out the rest of the
packet.
Create a new directory Find File packet but copy some of the essential info from the current packet . However be careful to zero out the rest of the packet .
static FF_PKT *new_dir_ff_pkt(FF_PKT *ff_pkt)
{
   FF_PKT *dir_ff_pkt = (FF_PKT *)bmalloc(sizeof(FF_PKT));
   memcpy(dir_ff_pkt, ff_pkt, sizeof(FF_PKT));
   dir_ff_pkt->fname = bstrdup(ff_pkt->fname);
   dir_ff_pkt->link = bstrdup(ff_pkt->link);
   dir_ff_pkt->sys_fname = get_pool_memory(PM_FNAME);
   if (ff_pkt->strip_snap_path) {
      dir_ff_pkt->fname_save = get_pool_memory(PM_FNAME);
      dir_ff_pkt->link_save = get_pool_memory(PM_FNAME);
      pm_strcpy(dir_ff_pkt->fname_save, ff_pkt->fname_save);
      pm_strcpy(dir_ff_pkt->link_save, ff_pkt->link_save);
      dir_ff_pkt->snap_top_fname = get_pool_memory(PM_FNAME);
      dir_ff_pkt->snap_fname = get_pool_memory(PM_FNAME);
   } else {
      dir_ff_pkt->fname_save = NULL;
      dir_ff_pkt->link_save = NULL;
   }
   dir_ff_pkt->included_files_list = NULL;
   dir_ff_pkt->excluded_files_list = NULL;
   dir_ff_pkt->excluded_paths_list = NULL;
   dir_ff_pkt->linkhash = NULL;
   dir_ff_pkt->ignoredir_fname = NULL;
   return dir_ff_pkt;
}
static FF_PKT * new_dir_ff_pkt ( FF_PKT * ff_pkt ) { FF_PKT * dir_ff_pkt = ( FF_PKT * ) bmalloc ( sizeof ( FF_PKT ) ) ; memcpy ( dir_ff_pkt , ff_pkt , sizeof ( FF_PKT ) ) ; dir_ff_pkt -> fname = bstrdup ( ff_pkt -> fname ) ; dir_ff_pkt -> link = bstrdup ( ff_pkt -> link ) ; dir_ff_pkt -> sys_fname = get_pool_memory ( PM_FNAME ) ; if ( ff_pkt -> strip_snap_path ) { dir_ff_pkt -> fname_save = get_pool_memory ( PM_FNAME ) ; dir_ff_pkt -> link_save = get_pool_memory ( PM_FNAME ) ; pm_strcpy ( dir_ff_pkt -> fname_save , ff_pkt -> fname_save ) ; pm_strcpy ( dir_ff_pkt -> link_save , ff_pkt -> link_save ) ; dir_ff_pkt -> snap_top_fname = get_pool_memory ( PM_FNAME ) ; dir_ff_pkt -> snap_fname = get_pool_memory ( PM_FNAME ) ; } else { dir_ff_pkt -> fname_save = NULL ; dir_ff_pkt -> link_save = NULL ; } dir_ff_pkt -> included_files_list = NULL ; dir_ff_pkt -> excluded_files_list = NULL ; dir_ff_pkt -> excluded_paths_list = NULL ; dir_ff_pkt -> linkhash = NULL ; dir_ff_pkt -> ignoredir_fname = NULL ; return dir_ff_pkt ; }
Create a new directory Find File packet, but copy
   some of the essential info from the current packet.
Create a new directory Find File packet but copy some of the essential info from the current packet .
// need its own "working" buffers, some pm_strcat or pm_strcopy // will realloc these ones, no need to copy the current values