Check-in [f626fcaab6]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Convert some fopen() calls to fossil_fopen(). Missed them previously.
Timelines: family | ancestors | descendants | both | windows-i18n
Files: files | file ages | folders
SHA1:f626fcaab66a38c4628732db207c24efb15c8b68
User & Date: drh 2011-05-20 11:22:42
Context
2011-05-20
11:24
Merge all the latest trunk changes into the windows-i18n branch. Closed-Leaf check-in: a742d12e8f user: drh tags: windows-i18n
11:22
Convert some fopen() calls to fossil_fopen(). Missed them previously. check-in: f626fcaab6 user: drh tags: windows-i18n
2011-05-13
20:30
Fix memory leaks in "fossil rebuild". check-in: 625226d577 user: drh tags: windows-i18n
Changes

Changes to src/main.c.

  1285   1285     if( zHost ) cgi_replace_parameter("HTTP_HOST",zHost);
  1286   1286     g.cgiOutput = 1;
  1287   1287     if( g.argc!=2 && g.argc!=3 && g.argc!=6 ){
  1288   1288       fossil_fatal("no repository specified");
  1289   1289     }
  1290   1290     g.fullHttpReply = 1;
  1291   1291     if( g.argc==6 ){
  1292         -    g.httpIn = fopen(g.argv[3], "rb");
  1293         -    g.httpOut = fopen(g.argv[4], "wb");
         1292  +    g.httpIn = fossil_fopen(g.argv[3], "rb");
         1293  +    g.httpOut = fossil_fopen(g.argv[4], "wb");
  1294   1294       zIpAddr = g.argv[5];
  1295   1295     }else{
  1296   1296       g.httpIn = stdin;
  1297   1297       g.httpOut = stdout;
  1298   1298       zIpAddr = 0;
  1299   1299     }
  1300   1300     find_server_repository(0);

Changes to src/main.mk.

   890    890   	$(XTCC) -o $(OBJDIR)/zip.o -c $(OBJDIR)/zip_.c
   891    891   
   892    892   $(OBJDIR)/zip.h:	$(OBJDIR)/headers
   893    893   $(OBJDIR)/sqlite3.o:	$(SRCDIR)/sqlite3.c
   894    894   	$(XTCC) -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_ENABLE_STAT2 -Dlocaltime=fossil_localtime -DSQLITE_ENABLE_LOCKING_STYLE=0 -c $(SRCDIR)/sqlite3.c -o $(OBJDIR)/sqlite3.o
   895    895   
   896    896   $(OBJDIR)/shell.o:	$(SRCDIR)/shell.c
   897         -	$(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
          897  +	$(XTCC) -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -Dfopen=fossil_fopen -c $(SRCDIR)/shell.c -o $(OBJDIR)/shell.o
   898    898   
   899    899   $(OBJDIR)/th.o:	$(SRCDIR)/th.c
   900    900   	$(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th.c -o $(OBJDIR)/th.o
   901    901   
   902    902   $(OBJDIR)/th_lang.o:	$(SRCDIR)/th_lang.c
   903    903   	$(XTCC) -I$(SRCDIR) -c $(SRCDIR)/th_lang.c -o $(OBJDIR)/th_lang.o
   904    904   

Changes to src/makemake.tcl.

   248    248   append opt " -DSQLITE_ENABLE_LOCKING_STYLE=0"
   249    249   set SQLITE_OPTIONS $opt
   250    250   writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/sqlite3.c -o \$(OBJDIR)/sqlite3.o\n"
   251    251   
   252    252   writeln "\$(OBJDIR)/shell.o:\t\$(SRCDIR)/shell.c"
   253    253   set opt {-Dmain=sqlite3_shell}
   254    254   append opt " -DSQLITE_OMIT_LOAD_EXTENSION=1"
          255  +append opt " -Dfopen=fossil_fopen"
   255    256   writeln "\t\$(XTCC) $opt -c \$(SRCDIR)/shell.c -o \$(OBJDIR)/shell.o\n"
   256    257   
   257    258   writeln "\$(OBJDIR)/th.o:\t\$(SRCDIR)/th.c"
   258    259   writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th.c -o \$(OBJDIR)/th.o\n"
   259    260   
   260    261   writeln "\$(OBJDIR)/th_lang.o:\t\$(SRCDIR)/th_lang.c"
   261    262   writeln "\t\$(XTCC) -I\$(SRCDIR) -c \$(SRCDIR)/th_lang.c -o \$(OBJDIR)/th_lang.o\n"

Changes to src/md5.c.

   374    374   */
   375    375   int md5sum_file(const char *zFilename, Blob *pCksum){
   376    376     FILE *in;
   377    377     MD5Context ctx;
   378    378     unsigned char zResult[16];
   379    379     char zBuf[10240];
   380    380   
   381         -  in = fopen(zFilename,"rb");
          381  +  in = fossil_fopen(zFilename,"rb");
   382    382     if( in==0 ){
   383    383       return 1;
   384    384     }
   385    385     MD5Init(&ctx);
   386    386     for(;;){
   387    387       int n;
   388    388       n = fread(zBuf, 1, sizeof(zBuf), in);

Changes to src/sha1.c.

   264    264   */
   265    265   int sha1sum_file(const char *zFilename, Blob *pCksum){
   266    266     FILE *in;
   267    267     SHA1Context ctx;
   268    268     unsigned char zResult[20];
   269    269     char zBuf[10240];
   270    270   
   271         -  in = fopen(zFilename,"rb");
          271  +  in = fossil_fopen(zFilename,"rb");
   272    272     if( in==0 ){
   273    273       return 1;
   274    274     }
   275    275     SHA1Init(&ctx);
   276    276     for(;;){
   277    277       int n;
   278    278       n = fread(zBuf, 1, sizeof(zBuf), in);