Check-in [034819087d]
Not logged in

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

Overview
Comment:Make blob_read_link() C89-compatible on Unix again.
Timelines: family | ancestors | descendants | both | symlinks
Files: files | file ages | folders
SHA1:034819087de9ca37a52d696ce865f60b2943398c
User & Date: dmitry 2011-08-28 11:22:36
Context
2011-08-31
09:55
Merge latest trunk. check-in: 40ed431ca5 user: dmitry tags: symlinks
2011-08-28
11:22
Make blob_read_link() C89-compatible on Unix again. check-in: 034819087d user: dmitry tags: symlinks
11:01
Use file_delete() instead of unlink() in vfile_to_disk(). check-in: 08311ffc6a user: dmitry tags: symlinks
Changes

Changes to src/blob.c.

   709    709   ** Any prior content of the blob is discarded, not freed.
   710    710   **
   711    711   ** Returns length of destination path.
   712    712   **
   713    713   ** On windows, zeros blob and returns 0.
   714    714   */
   715    715   int blob_read_link(Blob *pBlob, const char *zFilename){
   716         -  blob_zero(pBlob);
   717    716   #if !defined(_WIN32)
   718    717     char zBuf[1024];
   719    718     ssize_t len = readlink(zFilename, zBuf, 1023);
   720    719     if( len < 0 ){
   721    720       fossil_panic("cannot read symbolic link %s", zFilename);
   722    721     }
   723    722     zBuf[len] = 0;   /* null-terminate */
          723  +  blob_zero(pBlob);
   724    724     blob_appendf(pBlob, "%s", zBuf);
   725    725     return len;
   726    726   #else
          727  +  blob_zero(pBlob);
   727    728     return 0;
   728    729   #endif
   729    730   }
   730    731   
   731    732   
   732    733   /*
   733    734   ** Write the content of a blob into a file.