Chameleon

Chameleon Commit Details

Date:2010-03-09 21:09:00 (14 years 19 days ago)
Author:JrCs
Commit:124
Parents: 123
Message:Introduced strdup()
Changes:
M/branches/JrCs/i386/libsa/string.c
M/branches/JrCs/i386/libsaio/stringTable.c
M/branches/JrCs/i386/libsaio/sys.c
M/branches/JrCs/i386/libsa/libsa.h
M/branches/JrCs/i386/libsaio/saio_internal.h

File differences

branches/JrCs/i386/libsaio/sys.c
624624
625625
626626
627
627
628628
629629
630630
......
652652
653653
654654
655
655
656656
657657
658658
if (dirp == NULL)
goto error;
dirp->dir_path = newString(path);
dirp->dir_path = strdup(path);
if (dirp->dir_path == NULL)
goto error;
if (dirp == NULL)
goto error;
dirp->dir_path = newString(dirPath);
dirp->dir_path = strdup(dirPath);
if (dirp->dir_path == NULL)
goto error;
branches/JrCs/i386/libsaio/stringTable.c
708708
709709
710710
711
712
713
714
715
716
717
718
719711
720712
721713
return ret;
}
char * newString(const char * oldString)
{
if ( oldString )
return strcpy(malloc(strlen(oldString)+1), oldString);
else
return NULL;
}
/*
* Extracts the next argument from the command line, double quotes are allowed here.
*/
branches/JrCs/i386/libsaio/saio_internal.h
159159
160160
161161
162
163162
164163
165164
extern int loadSystemConfig(config_file_t *configBuff);
extern int loadHelperConfig(config_file_t *configBuff);
extern int loadOverrideConfig(config_file_t *configBuff);
extern char * newString(const char *oldString);
extern char * getNextArg(char ** ptr, char * val);
extern long ParseXMLFile( char * buffer, TagPtr * dict );
branches/JrCs/i386/libsa/libsa.h
9090
9191
9292
93
9394
9495
9596
extern int strlen(const char * str);
extern char * strcat(char * s1, const char * s2);
extern char * strncat(char * s1, const char * s2, size_t n);
extern char * strdup(const char *s1);
#if STRNCASECMP
extern int strncasecmp(const char * s1, const char * s2, size_t n);
branches/JrCs/i386/libsa/string.c
241241
242242
243243
244
245
246
247
248
244249
245250
246251
return(strncat(s1, s2, strlen(s2)));
}
char *strdup(const char *s1)
{
return strcpy (malloc (strlen (s1) + 1), s1);
}
#if STRNCASECMP
int strncasecmp(const char *s1, const char *s2, size_t len)
{

Archive Download the corresponding diff file

Revision: 124