Fix strcasecmp
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2019 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
2035b33670
commit
c24bbb10f5
@ -841,3 +841,8 @@
|
|||||||
|
|
||||||
0.4.11 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
0.4.11 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
|
* fs/fs_read.c and fs/fs_write.c. read() and write() to socket is the
|
||||||
|
same as recv() and send() with flags = 0. Fixed!
|
||||||
|
* net/recvfrom.c: Fix errors in return value from non-blocking socket read.
|
||||||
|
* lib/lib_strcasecmp.c and lib/lib_strncasecmp.c. Use of post-incremented
|
||||||
|
argument to macro caused strcasecmp() and strncasecmp() to fail.
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<tr align="center" bgcolor="#e4e4e4">
|
<tr align="center" bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
||||||
<p>Last Updated: August 8, 2009</p>
|
<p>Last Updated: August 15, 2009</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -1435,7 +1435,7 @@ Other memory:
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<pre><ul>
|
<ul><pre>
|
||||||
nuttx-0.4.10 2009-08-08 Gregory Nutt <spudmonkey@racsa.co.cr>
|
nuttx-0.4.10 2009-08-08 Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
* lib/: Added some basic regex-subset, pattern matching functions
|
* lib/: Added some basic regex-subset, pattern matching functions
|
||||||
@ -1499,9 +1499,15 @@ buildroot-0.1.7 2009-06-26 <spudmonkey@racsa.co.cr>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<pre><ul>
|
<ul><pre>
|
||||||
nuttx-0.4.11 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
nuttx-0.4.11 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
|
* fs/fs_read.c and fs/fs_write.c. read() and write() to socket is the
|
||||||
|
same as recv() and send() with flags = 0. Fixed!
|
||||||
|
* net/recvfrom.c: Fix errors in return value from non-blocking socket read.
|
||||||
|
* lib/lib_strcasecmp.c and lib/lib_strncasecmp.c. Use of post-incremented
|
||||||
|
argument to macro caused strcasecmp() and strncasecmp() to fail.
|
||||||
|
|
||||||
pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
buildroot-0.1.8 2009-xx-xx <spudmonkey@racsa.co.cr>
|
buildroot-0.1.8 2009-xx-xx <spudmonkey@racsa.co.cr>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* lib/lib_strcasecmp.c
|
* lib/lib_strcasecmp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -57,8 +57,13 @@ int strcasecmp(const char *cs, const char *ct)
|
|||||||
register signed char result;
|
register signed char result;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
if ((result = toupper(*cs) - toupper(*ct++)) != 0 || !*cs++)
|
if ((result = toupper(*cs) - toupper(*ct)) != 0 || !*cs)
|
||||||
break;
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
cs++;
|
||||||
|
ct++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* lib/lib_strncasecmp.c
|
* lib/lib_strncasecmp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -57,10 +57,13 @@ int strncasecmp(const char *cs, const char *ct, size_t nb)
|
|||||||
register signed char result = 0;
|
register signed char result = 0;
|
||||||
for (; nb > 0; nb--)
|
for (; nb > 0; nb--)
|
||||||
{
|
{
|
||||||
if ((result = toupper(*cs) - toupper(*ct++)) != 0 || !*cs++)
|
if ((result = toupper(*cs) - toupper(*ct)) != 0 || !*cs)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cs++;
|
||||||
|
ct++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user