Ignore:
Timestamp:
Apr 27, 2004, 8:39:34 PM (21 years ago)
Author:
bird
Message:

GCC v3.3.3 sources.

Location:
branches/GNU/src/gcc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gcc

    • Property svn:ignore
      •  

        old new  
        2626configure.vr
        2727configure.vrs
         28dir.info
        2829Makefile
        29 dir.info
        3030lost+found
        3131update.out
  • branches/GNU/src/gcc/fastjar/jartool.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r1390 r1391  
    239239#include "pushback.h"
    240240#include "compress.h"
     241
     242/* Some systems have mkdir that takes a single argument.  */
     243#ifdef MKDIR_TAKES_ONE_ARG
     244# define mkdir(a,b) mkdir(a)
     245#endif
     246
    241247
    242248#ifdef WORDS_BIGENDIAN
     
    434440  if(action == ACTION_CREATE){
    435441    if(jarfile){
    436       jarfd = open(jarfile, O_CREAT | O_BINARY | O_WRONLY | O_TRUNC,
    437                    S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
     442      jarfd = open(jarfile, O_CREAT | O_BINARY | O_WRONLY | O_TRUNC, 0666);
    438443
    439444      if(jarfd < 0){
     
    839844  }
    840845
    841   if(!strcmp(file, jarfile)){
     846  if(jarfile && !strcmp(file, jarfile)){
    842847    if(verbose)
    843848      printf("skipping: %s\n", file);
     
    920925      if(de->d_name[0] == '.')
    921926        continue;
    922       if(!strcmp(de->d_name, jarfile)){ /* we don't want to add ourselves.  Believe me */
     927      if(jarfile && !strcmp(de->d_name, jarfile)){
     928        /* we don't want to add ourselves.  Believe me */
    923929        if(verbose)
    924930          printf("skipping: %s\n", de->d_name);
     
    14501456
    14511457    if(f_fd != -1 && handle){
    1452       f_fd = creat((const char *)filename, 00644);
     1458      f_fd = open((const char *)filename,
     1459                  O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
    14531460
    14541461      if(f_fd < 0){
     
    14651472
    14661473    if(method == 8 || flags & 0x0008){
    1467       if(seekable)
    1468         lseek(fd, eflen, SEEK_CUR);
    1469       else
    14701474        consume(&pbf, eflen);
    14711475     
     
    15021506      }
    15031507
    1504       if(seekable)
    1505         lseek(fd, eflen, SEEK_CUR);
    1506       else
    15071508        consume(&pbf, eflen);
    15081509    }
     
    15651566  time_t tdate;
    15661567  struct tm *s_tm;
    1567   char ascii_date[30];
     1568  char ascii_date[31];
    15681569  zipentry ze;
    15691570
     
    16561657        s_tm = localtime(&tdate);
    16571658        strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm);
    1658       }
    1659 
    1660       if(filename_len < fnlen){
     1659        ascii_date[30] = '\0';
     1660      }
     1661
     1662      if(filename_len < fnlen + 1){
    16611663        if(filename != NULL)
    16621664          free(filename);
     
    17751777        s_tm = localtime(&tdate);
    17761778        strftime(ascii_date, 30, "%a %b %d %H:%M:%S %Z %Y", s_tm);
    1777       }
    1778 
    1779       if(filename_len < fnlen){
     1779        ascii_date[30] = '\0';
     1780      }
     1781
     1782      if(filename_len < fnlen + 1){
    17801783        if(filename != NULL)
    17811784          free(filename);
     
    18481851#endif
    18491852
     1853  if (seekable){
     1854    if (amt <= (int)pbf->buff_amt)
     1855      pb_read(pbf, buff, amt);
     1856    else {
     1857      lseek(pbf->fd, amt - pbf->buff_amt, SEEK_CUR);
     1858      pb_read(pbf, buff, pbf->buff_amt); /* clear pbf */
     1859    }
     1860  } else
    18501861  while(tc < amt){
    18511862    rdamt = pb_read(pbf, buff, ((amt - tc) < RDSZ ? (amt - tc) : RDSZ));
     
    18571868
    18581869#ifdef DEBUG
    1859   printf("%d bytes consumed\n", tc);
     1870  printf("%d bytes consumed\n", amt);
    18601871#endif
    18611872
Note: See TracChangeset for help on using the changeset viewer.