[Debian-in-workers] Bug#550047: latex-sanskrit: getline conflicts with POSIX:2008

Colin Watson cjwatson at ubuntu.com
Wed Oct 7 10:05:32 UTC 2009


Package: latex-sanskrit
Version: 2.2-4
Severity: important
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch karmic

POSIX:2008 defines a getline function, so latex-sanskrit fails to build
with recent (e)glibc because it defines its own. This patch renames the
function to get_line.

diff -u latex-sanskrit-2.2/skt.c latex-sanskrit-2.2/skt.c
--- latex-sanskrit-2.2/skt.c
+++ latex-sanskrit-2.2/skt.c
@@ -43,7 +43,7 @@
 void   write_outbuf(void);
 void   write_line  (char *);
 char * str_find    (char *, char *);
-void   getline     (void);
+void   get_line    (void);
 char * command     (char *);
 void   error       (char *, int);
 void   process     (void);
@@ -193,7 +193,7 @@
   printf("Enter text (blank line terminates program) :\n");
 #endif
 
-  getline(); if (eof_flag) { printf("No input text.\n"); exit(1); }
+  get_line(); if (eof_flag) { printf("No input text.\n"); exit(1); }
 
 #if (DEBUG == 0)
 
@@ -245,7 +245,7 @@
       if (p == 0)
         { if (sktline == TRUE) { strcat(outbuf,i_ptr); write_outbuf(); }
           else { write_line(inbuf); o_ptr = outbuf; *o_ptr = '\0';  }
-          getline(); 
+          get_line(); 
           continue; 
         }
       q = i_ptr; i_ptr = p;
@@ -337,7 +337,7 @@
 /* Function: get another line from input file; reset i_ptr, increments        */
 /*           line_cnt, and sets eof_flag if EOF.                              */
 
-void getline(void)
+void get_line(void)
 { 
 char *p;
   i_ptr = inbuf;
@@ -452,12 +452,12 @@
     c = *i_ptr; d = *(i_ptr+1);
 /* END OF LINE */
     if ((c == '\0') || (c == '\n'))
-      { sktword(); strcat (outbuf,i_ptr); write_outbuf(); getline(); CC; }
+      { sktword(); strcat (outbuf,i_ptr); write_outbuf(); get_line(); CC; }
 /* COMMENT DELIMITER */
     if (c == '%')
     { if (*(i_ptr+1) == '\n') sktcont();
       else sktword();
-      strcat(outbuf,i_ptr); write_outbuf(); getline(); CC;
+      strcat(outbuf,i_ptr); write_outbuf(); get_line(); CC;
     }
 /* ILLEGAL CHARS */
     if (strchr("&fqwxzFQWXZ\177",c))

Thanks,

-- 
Colin Watson                                       [cjwatson at ubuntu.com]





More information about the Debian-in-workers mailing list