[BACK]Return to mdoc_strings.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/Attic/mdoc_strings.c between version 1.12 and 1.14

version 1.12, 2009/10/27 08:26:12 version 1.14, 2010/01/01 17:14:30
Line 14 
Line 14 
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF   * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */   */
   #ifdef HAVE_CONFIG_H
   #include "config.h"
   #endif
   
 #include <sys/types.h>  #include <sys/types.h>
   
 #include <assert.h>  #include <assert.h>
Line 56  static const struct mdoc_secname secnames[SECNAME_MAX]
Line 60  static const struct mdoc_secname secnames[SECNAME_MAX]
         { "SECURITY CONSIDERATIONS", SEC_SECURITY }          { "SECURITY CONSIDERATIONS", SEC_SECURITY }
 };  };
   
 #ifdef __linux__  
 extern  char            *strptime(const char *, const char *, struct tm *);  
 #endif  
   
   
 int  int
 mdoc_iscdelim(char p)  mdoc_iscdelim(char p)
 {  {
Line 122  mdoc_atosec(const char *p)
Line 122  mdoc_atosec(const char *p)
                         return(secnames[i].sec);                          return(secnames[i].sec);
   
         return(SEC_CUSTOM);          return(SEC_CUSTOM);
 }  
   
   
 time_t  
 mdoc_atotime(const char *p)  
 {  
         struct tm        tm;  
         char            *pp;  
   
         memset(&tm, 0, sizeof(struct tm));  
   
         if (0 == strcmp(p, "$" "Mdocdate$"))  
                 return(time(NULL));  
         if ((pp = strptime(p, "$" "Mdocdate: %b %d %Y $", &tm)) && 0 == *pp)  
                 return(mktime(&tm));  
         /* XXX - this matches "June 1999", which is wrong. */  
         if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp)  
                 return(mktime(&tm));  
         if ((pp = strptime(p, "%b %d, %Y", &tm)) && 0 == *pp)  
                 return(mktime(&tm));  
   
         return(0);  
 }  }
   
   

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.14

CVSweb