utils/strdup.c: StrDup() and mode constifiy impl

This commit is contained in:
Darryl L. Miles 2024-10-12 07:47:55 +01:00 committed by Tim Edwards
parent 77f04b4e80
commit 91da638579
2 changed files with 8 additions and 8 deletions

View File

@ -53,7 +53,7 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
char *
StrDup(oldstr, str)
char **oldstr;
char *str;
const char *str;
{
char *newstr;
@ -90,7 +90,7 @@ StrDup(oldstr, str)
bool
StrIsWhite(line, commentok)
char *line;
const char *line;
bool commentok; /* TRUE means # comments are considered all-white */
{
if ( (*line == '#') && commentok)
@ -123,7 +123,7 @@ StrIsWhite(line, commentok)
bool
StrIsInt(s)
char *s;
const char *s;
{
if (*s == '-' || *s == '+') s++;
while (*s)
@ -152,7 +152,7 @@ StrIsInt(s)
bool
StrIsNumeric(s)
char *s;
const char *s;
{
double result;
char *endptr;

View File

@ -50,12 +50,12 @@ extern int PaExpand(char **, char **, int);
extern char *nextName();
extern FILE *PaOpen(char *, char *, char *, char *, char *, char **);
extern FILE *PaLockOpen(char *, char *, char *, char *, char *, char **, bool *, int *);
extern char *StrDup(char **, char *);
extern char *StrDup(char **, const char *);
extern int Match();
extern char *ArgStr();
extern bool StrIsWhite(char *, bool);
extern bool StrIsInt(char *);
extern bool StrIsNumeric(char *);
extern bool StrIsWhite(const char *, bool);
extern bool StrIsInt(const char *);
extern bool StrIsNumeric(const char *);
/* C99 compat */
extern void PaAppend(char **, char *);