diff -ur chktex-1.6.4.orig/ChkTeX.c chktex-1.6.4/ChkTeX.c --- chktex-1.6.4.orig/ChkTeX.c 2007-10-20 09:10:48.000000000 +0200 +++ chktex-1.6.4/ChkTeX.c 2010-05-02 22:03:42.263715013 +0200 @@ -563,8 +563,8 @@ { #ifndef STRIP_DEBUG unsigned long Cnt; - char *String; - char *iuStr = ""; + const char *String; + const char *iuStr = ""; if (DebugLevel & FLG_DbgMsgs) { @@ -995,7 +995,7 @@ void PrintPrgErr(enum PrgErrNum Error, ...) { - char *Type; + const char *Type; va_list MsgArgs; if (betw(pmMinFault, Error, pmMaxFault)) diff -ur chktex-1.6.4.orig/ChkTeX.h chktex-1.6.4/ChkTeX.h --- chktex-1.6.4.orig/ChkTeX.h 2007-10-20 09:10:48.000000000 +0200 +++ chktex-1.6.4/ChkTeX.h 2010-05-02 21:56:55.612231528 +0200 @@ -247,7 +247,7 @@ { char *Data; const char *LineBuf; - char *File; + const char *File; unsigned long Line, Column, ErrLen; enum { @@ -277,11 +277,11 @@ DEF(int, UsingStdIn, FALSE) \ DEF(int, InputFiles, TRUE) \ DEF(int, HeadErrOut, TRUE) \ - DEF(char *, OutputName, "") \ - DEF(char *, PseudoInName, NULL) \ + DEF(const char *, OutputName, "") \ + DEF(const char *, PseudoInName, NULL) \ DEF(char *, OutputFormat, VerbNormal) \ DEF(char *, PipeOutputFormat, NULL) \ - DEF(char *, Delimit, ":") \ + DEF(const char *, Delimit, ":") \ DEF(long, DebugLevel, 0) #define STATE_VARS \ @@ -290,7 +290,7 @@ DEF(int, InHeader, TRUE) /* Whether we're in the header */ \ DEF(int, VerbMode, FALSE) /* Whether we're in complete ignore-mode */ \ DEF(long, MathMode, 0) /* Whether we're in math mode or not */ \ - DEF(char *, VerbStr, "") /* String we'll terminate verbmode upon */ \ + DEF(const char *, VerbStr, "") /* String we'll terminate verbmode upon */ \ DEF(unsigned long, ErrPrint, 0) /* # errors printed */ \ DEF(unsigned long, WarnPrint, 0) /* # warnings printed */ \ DEF(unsigned long, UserSupp, 0) /* # user suppressed warnings */ diff -ur chktex-1.6.4.orig/FindErrs.c chktex-1.6.4/FindErrs.c --- chktex-1.6.4.orig/FindErrs.c 2007-10-20 09:10:48.000000000 +0200 +++ chktex-1.6.4/FindErrs.c 2010-05-02 22:12:06.244928101 +0200 @@ -363,9 +363,9 @@ } -static char *Dot2Str(enum DotLevel dl) +static const char *Dot2Str(enum DotLevel dl) { - char *Retval = INTERNFAULT; + const char *Retval = INTERNFAULT; switch (dl) { case dtUnknown: @@ -590,8 +590,8 @@ dotlev = CheckDots(CmdPtr, BufPtr); if (dotlev && (dotlev != realdl)) { - TmpPtr = Dot2Str(dotlev); - PSERRA(CmdPtr - Buf, CmdLen, emEllipsis, TmpPtr); + const char *cTmpPtr = Dot2Str(dotlev); + PSERRA(CmdPtr - Buf, CmdLen, emEllipsis, cTmpPtr); } } @@ -966,9 +966,10 @@ case '.': if ((Char == *BufPtr) && (Char == BufPtr[1])) { + const char *cTmpPtr; dotlev = CheckDots(&PrePtr[1], &BufPtr[2]); - TmpPtr = Dot2Str(dotlev); - HEREA(3, emEllipsis, TmpPtr); + cTmpPtr = Dot2Str(dotlev); + HEREA(3, emEllipsis, cTmpPtr); } /* Regexp: "([^A-Z@.])\.[.!?:;]*\s+[a-z]" */ @@ -1231,7 +1232,7 @@ * suffix should be put, e.g. "warning%s". Watch your %'s! */ -static void Transit(FILE * fh, unsigned long Cnt, char *Str) +static void Transit(FILE * fh, unsigned long Cnt, const char *Str) { switch (Cnt) { @@ -1468,7 +1469,7 @@ static enum ErrNum PerformCommand(const char *Cmd, char *Arg) { - char *Argument = ""; + const char *Argument = ""; enum ErrNum en = emMinFault; int TmpC; diff -ur chktex-1.6.4.orig/FindErrs.h chktex-1.6.4/FindErrs.h --- chktex-1.6.4.orig/FindErrs.h 2004-12-31 23:22:01.000000000 +0100 +++ chktex-1.6.4/FindErrs.h 2010-05-02 21:50:34.032246285 +0200 @@ -162,7 +162,7 @@ /* Requirements posed upon environment */ enum Context Context; - char *Message; + const char *Message; }; enum ItState diff -ur chktex-1.6.4.orig/OpSys.c chktex-1.6.4/OpSys.c --- chktex-1.6.4.orig/OpSys.c 2007-10-20 09:10:48.000000000 +0200 +++ chktex-1.6.4/OpSys.c 2010-05-02 22:18:12.805229781 +0200 @@ -110,8 +110,8 @@ #endif char ConfigFile[BUFSIZ] = LOCALRCFILE; -char *ReverseOn; -char *ReverseOff; +const char *ReverseOn; +const char *ReverseOff; static int HasFile(char *Dir, const char *Filename, const char *App); @@ -256,6 +256,7 @@ char *termtype = getenv("TERM"); int success; char *buffer; + static char str_so[3] = "so", str_se[3] = "se"; if (termtype) { @@ -267,8 +268,8 @@ PrintPrgErr(pmNoTermDefd); buffer = (char *) malloc(sizeof(term_buffer)); - ReverseOn = tgetstr("so", &buffer); - ReverseOff = tgetstr("se", &buffer); + ReverseOn = tgetstr(str_so, &buffer); + ReverseOff = tgetstr(str_se, &buffer); if (ReverseOn && ReverseOff) return; diff -ur chktex-1.6.4.orig/OpSys.h chktex-1.6.4/OpSys.h --- chktex-1.6.4.orig/OpSys.h 2005-01-03 01:39:20.000000000 +0100 +++ chktex-1.6.4/OpSys.h 2010-05-02 22:18:32.084824903 +0200 @@ -182,8 +182,8 @@ * source tree. :-/ */ -extern char *ReverseOn; -extern char *ReverseOff; +extern const char *ReverseOn; +extern const char *ReverseOff; extern char ConfigFile[BUFSIZ]; char *MatchFileName(char *String); diff -ur chktex-1.6.4.orig/Resource.c chktex-1.6.4/Resource.c --- chktex-1.6.4.orig/Resource.c 2004-06-06 07:23:04.000000000 +0200 +++ chktex-1.6.4/Resource.c 2010-05-02 21:32:29.830863107 +0200 @@ -34,7 +34,7 @@ #define LNEMPTY(a) struct WordList a = {0, 1, {0}, {0}}; #define LIST(a) struct WordList a = {0, 0, {0}, {0}}; #define LCASE(a) LIST(a) LIST(a ## Case) -#define KEY(a,def) char *a = def; +#define KEY(a,def) const char *a = def; RESOURCE_INFO #undef KEY @@ -43,8 +43,8 @@ #undef LIST struct KeyWord { - char *Name; - char **String; /* Keyword = item */ + const char *Name; + const char **String; /* Keyword = item */ struct WordList *List, /* Case-sensitive strings */ *CaseList; /* Case-insensitive strings */ }; @@ -106,7 +106,7 @@ int ReadRC(const char *Filename) { - char *String = NULL; + const char *String = NULL; int Success = FALSE; FILE *fh; enum Token Token; diff -ur chktex-1.6.4.orig/Resource.h chktex-1.6.4/Resource.h --- chktex-1.6.4.orig/Resource.h 2004-12-31 23:36:37.000000000 +0100 +++ chktex-1.6.4/Resource.h 2010-05-02 21:26:29.414537608 +0200 @@ -48,7 +48,7 @@ #define LIST(a) extern struct WordList a; #define LNEMPTY LIST #define LCASE(a) LIST(a) LIST(a ## Case) -#define KEY(a,def) extern char *a; +#define KEY(a,def) extern const char *a; RESOURCE_INFO #undef KEY diff -ur chktex-1.6.4.orig/Utility.c chktex-1.6.4/Utility.c --- chktex-1.6.4.orig/Utility.c 2004-12-31 23:22:01.000000000 +0100 +++ chktex-1.6.4/Utility.c 2010-05-02 21:59:51.240570213 +0200 @@ -367,7 +367,7 @@ * */ -int strinfront(char *Str, char *Cmp) +int strinfront(const char *Str, const char *Cmp) { int CmpLen; @@ -685,7 +685,7 @@ } -int PushFile(char *Name, FILE * fh, struct Stack *stack) +int PushFile(const char *Name, FILE * fh, struct Stack *stack) { struct FileNode *fn; @@ -735,10 +735,10 @@ return (Retval); } -char *CurStkName(struct Stack *stack) +const char *CurStkName(struct Stack *stack) { struct FileNode *fn; - static char *LastName = ""; + static const char *LastName = ""; if (PseudoInName && (stack->Used <= 1)) return (PseudoInName); diff -ur chktex-1.6.4.orig/Utility.h chktex-1.6.4/Utility.h --- chktex-1.6.4.orig/Utility.h 2004-12-31 23:22:01.000000000 +0100 +++ chktex-1.6.4/Utility.h 2010-05-02 21:59:49.476606920 +0200 @@ -105,7 +105,7 @@ void strxrep(char *Buf, const char *Prot, const char To); char *strip(char *String, const enum Strip What); void strwrite(char *To, const char *From, unsigned long Len); -int strinfront(char *Str, char *Cmp); +int strinfront(const char *Str, const char *Cmp); char *strdupx(const char *String, int Extra); void strmove(char *a, const char *b); @@ -124,11 +124,11 @@ void *StkTop(struct Stack *Stack); FILE *CurStkFile(struct Stack *stack); -char *CurStkName(struct Stack *stack); +const char *CurStkName(struct Stack *stack); unsigned long CurStkLine(struct Stack *stack); char *FGetsStk(char *Dest, unsigned long len, struct Stack *stack); int PushFileName(const char *Name, struct Stack *stack); -int PushFile(char *, FILE *, struct Stack *); +int PushFile(const char *, FILE *, struct Stack *); void FreeErrInfo(struct ErrInfo *ei);