[comp.sources.bugs] lharc fixes

paquette@cpsc.ucalgary.ca (Trevor Paquette) (03/16/90)

 The fix to getting lharc to work is actually quite simple.
Change the following lines in "lharc.c":

about line 811:
 CHANGE
   if (!lower_case_used && isupper (name[i]))
     name[i] = tolower (name[i]);

 TO
   if (!lower_case_used && isupper (name[i])) {
         /* name[i] = tolower (name[i]); */
   }

 or just comment out the entire if statement.


about line 1120
 CHANGE
  for ( ptr = data + I_NAME, cnt = 0; cnt < name_length; ptr++, cnt++ )
  {
   *ptr = toupper(*ptr);

    if ( *ptr == '/' )


 TO
  for ( ptr = data + I_NAME, cnt = 0; cnt < name_length; ptr++, cnt++ )
  {
  /*  *ptr = toupper(*ptr);*/

    if ( *ptr == '/' )


 Comment out the toupper function call. This should make it work. I know it
now works on Suns.
  hope this helps.
 
  Trev

___________________________________________/No man is a failure who has friends
Trevor Paquette  ICBM:51'03"N/114'05"W|I accept the challange, body and soul,
{ubc-cs,utai,alberta}!calgary!paquette|to seek the knowledge of the ones of old
paquette@cpsc.ucalgary.ca             | - engraved on the Kersa Blade of Esalon

linden@natasha.fwi.uva.nl (Onno van der Linden) (03/20/90)

 Recently,Harry Langenbacher wrote in the last couple of lines
of his posting:

>
>Does anyone know how to get lharc to handle directory names without barfing ?
>
>thanx
>
>
>- Harry Langenbacher 818-354-9513
>harry%neuron1@jpl-mil.jpl.nasa.gov
>harry@neuron1.jpl.nasa.gov 128.149.12.7

 Well, below are the diffs I made for lharc.c and it seems to work OK
on a SUN-4 (SPARCstation 1,to be more specific).

Onno van der Linden
linden@fwi.uva.nl

--------------------------cut here-------------------------------

*** lharc.c	Tue Mar 20 10:37:30 1990
--- old/lharc.c	Mon Mar 12 10:38:06 1990
***************
*** 24,30 ****
  #include <profile.h>
  #endif
  
! /* #define STRICT */
  #define FASTCOPY
  
  #ifdef MSDOS
--- 24,30 ----
  #include <profile.h>
  #endif
  
! #define STRICT
  #define FASTCOPY
  
  #ifdef MSDOS
***************
*** 320,326 ****
  char *myname;
  
  
! void userbreak()
  {
      error("Interrupt.");
  }
--- 320,326 ----
  char *myname;
  
  
! void userbreak(void)
  {
      error("Interrupt.");
  }
***************
*** 459,477 ****
  
  print_tiny_usage_and_exit ()
  {
!   printf("\nC-LHarc for %s Version 1.00   (C) 1989-1990 Y.Tagawa, Kai Uwe Rommel\n\
! \nUsage: %s {axevlufdmctp}[qnftv] archive_file [files or directories...]\n", SYSNAME, myname);
!   printf("\nCommands:                    Options:\n\
! a   Append                   q   quiet\n\
! x,e EXtract                  n   no execute\n\
! v,l View/List                f   force (over write at extract)\n\
! u   Update                   t   files are TEXT files\n\
! f   Freshen                  v<pager>  use file pager for p command\n\
! d   Delete\n\
! m   Move\n\
! c   re-Construct new archive\n\
! t   Test archive\n\
! p   Print to STDOUT\n");
    exit (1);
  }
  
--- 459,478 ----
  
  print_tiny_usage_and_exit ()
  {
!   printf("\nC-LHarc for %s Version 1.00   (C) 1989-1990 Y.Tagawa, Kai Uwe Rommel\n"
!          "\nUsage: %s {axevlufdmctp}[qnftv] archive_file [files or directories...]\n",
!          SYSNAME, myname);
!   printf("\nCommands:                    Options:\n"
!          "  a   Append                   q   quiet\n"
!          "  x,e EXtract                  n   no execute\n"
!          "  v,l View/List                f   force (over write at extract)\n"
!          "  u   Update                   t   files are TEXT files\n"
!          "  f   Freshen                  v<pager>  use file pager for p command\n"
!          "  d   Delete\n"
!          "  m   Move\n"
!          "  c   re-Construct new archive\n"
!          "  t   Test archive\n"
!          "  p   Print to STDOUT\n");
    exit (1);
  }
  
***************
*** 1956,1964 ****
  	  if (noexec)
  	    fprintf (stderr, "APPEND %s\n", name);
            else
! /* #ifdef STRICT */
              if ( !directory )
! /* #endif */
                if ( !update_freshen || (cmp == 0) )
                  append_one (fp, nafp, &hdr);
  	}
--- 1957,1965 ----
  	  if (noexec)
  	    fprintf (stderr, "APPEND %s\n", name);
            else
! #ifdef STRICT
              if ( !directory )
! #endif
                if ( !update_freshen || (cmp == 0) )
                  append_one (fp, nafp, &hdr);
  	}
***************
*** 2041,2048 ****
  #define O_BINARY 0
  #endif
  
! copy_archive(src,dst)
! char	*src,*dst;
  {
    int ih, oh;
    unsigned chunk;
--- 2042,2048 ----
  #define O_BINARY 0
  #endif
  
! copy_archive(char *src, char *dst)
  {
    int ih, oh;
    unsigned chunk;