|
@@ -15,8 +15,8 @@
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
* GNU General Public License for more details.
|
|
*
|
|
*
|
|
- * You should have received a copy of the GNU General Public License
|
|
|
|
- * along with this program; if not, write to the Free Software
|
|
|
|
|
|
+ * You should have received a copy of the GNU General Public License
|
|
|
|
+ * along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*
|
|
*
|
|
*/
|
|
*/
|
|
@@ -28,22 +28,27 @@
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
-#include "parser_f.h"
|
|
|
|
|
|
+#include "parser_f.h"
|
|
#include "../ut.h"
|
|
#include "../ut.h"
|
|
|
|
|
|
/** @brief returns pointer to next line or after the end of buffer */
|
|
/** @brief returns pointer to next line or after the end of buffer */
|
|
-char* eat_line(char* buffer, unsigned int len)
|
|
|
|
|
|
+char *eat_line(char *buffer, unsigned int len)
|
|
{
|
|
{
|
|
- char* nl;
|
|
|
|
|
|
+ char *nl;
|
|
|
|
|
|
/* jku .. replace for search with a library function; not conforming
|
|
/* jku .. replace for search with a library function; not conforming
|
|
as I do not care about CR
|
|
as I do not care about CR
|
|
*/
|
|
*/
|
|
- nl=(char *)q_memchr( buffer, '\n', len );
|
|
|
|
- if ( nl ) {
|
|
|
|
- if ( nl + 1 < buffer+len) nl++;
|
|
|
|
- if (( nl+1<buffer+len) && * nl=='\r') nl++;
|
|
|
|
- } else nl=buffer+len;
|
|
|
|
|
|
+ nl = (char *)q_memchr(buffer, '\n', len);
|
|
|
|
+ if(nl) {
|
|
|
|
+ if(nl + 1 < buffer + len) {
|
|
|
|
+ nl++;
|
|
|
|
+ }
|
|
|
|
+ if((nl + 1 < buffer + len) && *nl == '\r') {
|
|
|
|
+ nl++;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ nl = buffer + len;
|
|
|
|
+ }
|
|
return nl;
|
|
return nl;
|
|
}
|
|
}
|
|
-
|
|
|