Changeset 1391 for branches/GNU/src/gcc/fastjar/jartool.c
- Timestamp:
- Apr 27, 2004, 8:39:34 PM (21 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 dir.info 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/fastjar/jartool.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r1390 r1391 239 239 #include "pushback.h" 240 240 #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 241 247 242 248 #ifdef WORDS_BIGENDIAN … … 434 440 if(action == ACTION_CREATE){ 435 441 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); 438 443 439 444 if(jarfd < 0){ … … 839 844 } 840 845 841 if( !strcmp(file, jarfile)){846 if(jarfile && !strcmp(file, jarfile)){ 842 847 if(verbose) 843 848 printf("skipping: %s\n", file); … … 920 925 if(de->d_name[0] == '.') 921 926 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 */ 923 929 if(verbose) 924 930 printf("skipping: %s\n", de->d_name); … … 1450 1456 1451 1457 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); 1453 1460 1454 1461 if(f_fd < 0){ … … 1465 1472 1466 1473 if(method == 8 || flags & 0x0008){ 1467 if(seekable)1468 lseek(fd, eflen, SEEK_CUR);1469 else1470 1474 consume(&pbf, eflen); 1471 1475 … … 1502 1506 } 1503 1507 1504 if(seekable)1505 lseek(fd, eflen, SEEK_CUR);1506 else1507 1508 consume(&pbf, eflen); 1508 1509 } … … 1565 1566 time_t tdate; 1566 1567 struct tm *s_tm; 1567 char ascii_date[3 0];1568 char ascii_date[31]; 1568 1569 zipentry ze; 1569 1570 … … 1656 1657 s_tm = localtime(&tdate); 1657 1658 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){ 1661 1663 if(filename != NULL) 1662 1664 free(filename); … … 1775 1777 s_tm = localtime(&tdate); 1776 1778 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){ 1780 1783 if(filename != NULL) 1781 1784 free(filename); … … 1848 1851 #endif 1849 1852 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 1850 1861 while(tc < amt){ 1851 1862 rdamt = pb_read(pbf, buff, ((amt - tc) < RDSZ ? (amt - tc) : RDSZ)); … … 1857 1868 1858 1869 #ifdef DEBUG 1859 printf("%d bytes consumed\n", tc);1870 printf("%d bytes consumed\n", amt); 1860 1871 #endif 1861 1872 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.