*** orig/freebirth-0.3.2/raw_wave.c	Thu Jan 13 01:40:33 2000
--- freebirth-0.3.2/raw_wave.c	Sat May 10 14:53:49 2003
***************
*** 28,38 ****
    char *full_fn;
    char *fb_samples;
  
-   if (fn == NULL || fn[0] == '/') return fn;
    fb_samples = getenv("FB_SAMPLES");
    if (fb_samples == NULL) fb_samples = FB_SAMPLES;
!   sprintf(full_fn = (char *)malloc(strlen(fb_samples) + 1 + strlen(fn) + 1),
! 	  "%s/%s", fb_samples, fn);
    return full_fn;
  }
  
--- 28,43 ----
    char *full_fn;
    char *fb_samples;
  
    fb_samples = getenv("FB_SAMPLES");
    if (fb_samples == NULL) fb_samples = FB_SAMPLES;
!   full_fn = (char *)malloc(strlen(fb_samples) + 1 + strlen(fn) + 1);
!    
!   if (fn == NULL || fn[0] == '/') { /* path is valid already */
!      sprintf(full_fn, "%s", fn); 
!   } else {
!      sprintf(full_fn, "%s/%s", fb_samples, fn); /* add path */
!   }
!    
    return full_fn;
  }
  
***************
*** 47,53 ****
    int block_size = 8192;
    int current_block = 0;
    int count         = 0;
!   
    in = fopen(this->filename,"r");
    /* PATCH BY: adam sjogren asjo@diku.dk */
    if( in==NULL )
--- 52,58 ----
    int block_size = 8192;
    int current_block = 0;
    int count         = 0;
! 
    in = fopen(this->filename,"r");
    /* PATCH BY: adam sjogren asjo@diku.dk */
    if( in==NULL )
***************
*** 145,151 ****
  void raw_wave_set_sample_file(raw_wave* this, char *filename)
  {
    FILE *in;
!   if (this->filename != 0) free(this->filename);
    this->filename = get_full_path(filename);
    in = fopen(this->filename,"r");
    if( in==NULL )
--- 150,156 ----
  void raw_wave_set_sample_file(raw_wave* this, char *filename)
  {
    FILE *in;
!   if (this->filename != NULL) free(this->filename);
    this->filename = get_full_path(filename);
    in = fopen(this->filename,"r");
    if( in==NULL )
***************
*** 243,249 ****
    /* set table to zero here check if it is zero in */
    /* _fill_table */
    out->table = 0;
!   out->filename = 0;
    raw_wave_set_sample_file(out, filename);
  
    out->buffer   = (sample *)malloc(sizeof(sample) * TBASS_BUFF_SIZE);
--- 248,254 ----
    /* set table to zero here check if it is zero in */
    /* _fill_table */
    out->table = 0;
!   out->filename = NULL;
    raw_wave_set_sample_file(out, filename);
  
    out->buffer   = (sample *)malloc(sizeof(sample) * TBASS_BUFF_SIZE);
