Changeset 1811 for trunk/src/kmk/misc.c
- Timestamp:
- Oct 10, 2008, 7:19:58 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/misc.c
r1535 r1811 20 20 #include "dep.h" 21 21 #include "debug.h" 22 #ifdef CONFIG_WITH_VALUE_LENGTH 23 # include <assert.h> 24 #endif 22 25 23 26 /* All bcopy calls in this file can be replaced by memcpy and save a tick or two. */ … … 83 86 This is done by copying the text at LINE into itself. */ 84 87 88 #ifndef CONFIG_WITH_VALUE_LENGTH 85 89 void 86 90 collapse_continuations (char *line) 91 #else 92 char * 93 collapse_continuations (char *line, unsigned int linelen) 94 #endif 87 95 { 88 96 register char *in, *out, *p; … … 90 98 register unsigned int bs_write; 91 99 100 #ifndef CONFIG_WITH_VALUE_LENGTH 92 101 in = strchr (line, '\n'); 93 102 if (in == 0) 94 103 return; 104 #else 105 assert (strlen (line) == linelen); 106 in = memchr (line, '\n', linelen); 107 if (in == 0) 108 return line + linelen; 109 #endif 95 110 96 111 out = in; … … 158 173 159 174 *out = '\0'; 175 #ifdef CONFIG_WITH_VALUE_LENGTH 176 assert (strchr (line, '\0') == out); 177 return out; 178 #endif 160 179 } 161 180
Note:
See TracChangeset
for help on using the changeset viewer.