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

Diff for /mandoc/demandoc.c between version 1.5 and 1.11

version 1.5, 2011/09/01 22:09:50 version 1.11, 2014/08/10 23:54:41
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"  #include "config.h"
 #endif  
   
   #include <sys/types.h>
   
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
 #include <getopt.h>  #include <getopt.h>
Line 76  main(int argc, char *argv[])
Line 76  main(int argc, char *argv[])
         argc -= optind;          argc -= optind;
         argv += optind;          argv += optind;
   
         mp = mparse_alloc(MPARSE_AUTO, MANDOCLEVEL_FATAL, NULL, NULL);          mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_FATAL, NULL, NULL);
         assert(mp);          assert(mp);
   
         if (0 == argc)          if (0 == argc)
Line 110  pmandoc(struct mparse *mp, int fd, const char *fn, int
Line 110  pmandoc(struct mparse *mp, int fd, const char *fn, int
                 return;                  return;
         }          }
   
         mparse_result(mp, &mdoc, &man);          mparse_result(mp, &mdoc, &man, NULL);
         line = 1;          line = 1;
         col = 0;          col = 0;
   
Line 132  static void
Line 132  static void
 pstring(const char *p, int col, int *colp, int list)  pstring(const char *p, int col, int *colp, int list)
 {  {
         enum mandoc_esc  esc;          enum mandoc_esc  esc;
         const char      *start;          const char      *start, *end;
         int              emit;          int              emit;
   
         /*          /*
Line 161  again:
Line 161  again:
                         } else if (isspace((unsigned char)*p))                          } else if (isspace((unsigned char)*p))
                                 break;                                  break;
   
                 if (emit && p - start >= 2) {                  end = p - 1;
                         for ( ; start != p; start++)  
                   while (end > start)
                           if ('.' == *end || ',' == *end ||
                                           '\'' == *end || '"' == *end ||
                                           ')' == *end || '!' == *end ||
                                           '?' == *end || ':' == *end ||
                                           ';' == *end)
                                   end--;
                           else
                                   break;
   
                   if (emit && end - start >= 1) {
                           for ( ; start <= end; start++)
                                 if (ASCII_HYPH == *start)                                  if (ASCII_HYPH == *start)
                                         putchar('-');                                          putchar('-');
                                 else                                  else

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.11

CVSweb