Changeset 473 in openpam
- Timestamp:
- Nov 3, 2011, 10:48:25 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/openpam_readline.c
r437 r473 88 88 /* eof */ 89 89 if (ch == EOF) { 90 /* remove trailing whitespace */ 91 while (len > 0 && isspace((unsigned char)line[len - 1])) 92 --len; 93 line[len] = '\0'; 94 if (len == 0) 95 goto fail; 90 /* done */ 96 91 break; 97 92 } … … 100 95 if (lineno != NULL) 101 96 ++*lineno; 102 103 /* remove trailing whitespace */104 while (len > 0 && isspace((unsigned char)line[len - 1]))105 --len;106 line[len] = '\0';107 97 /* skip blank lines */ 108 98 if (len == 0) … … 111 101 if (line[len - 1] == '\\') { 112 102 line[--len] = '\0'; 113 /* fall through to whitespace case */ 114 } else { 115 break; 103 continue; 116 104 } 105 /* done */ 106 break; 117 107 } 118 108 /* whitespace */ … … 128 118 } 129 119 120 /* remove trailing whitespace */ 121 while (len > 0 && isspace((unsigned char)line[len - 1])) 122 --len; 123 line[len] = '\0'; 124 if (len == 0) 125 goto fail; 130 126 if (lenp != NULL) 131 127 *lenp = len; … … 141 137 * 142 138 * The =openpam_readline function performs a certain amount of processing 143 * on the data it reads. 144 * Comments (introduced by a hash sign) are stripped, as is leading and 145 * trailing whitespace. 146 * Any amount of linear whitespace is collapsed to a single space. 147 * Blank lines are ignored. 148 * If a line ends in a backslash, the backslash is stripped and the next 149 * line is appended. 139 * on the data it reads: 140 * 141 * - Comments (introduced by a hash sign) are stripped, as is leading and 142 * trailing whitespace. 143 * - Any amount of linear whitespace is collapsed to a single space. 144 * - Blank lines are ignored. 145 * - If a line ends in a backslash, the backslash is stripped and the 146 * next line is appended. 150 147 * 151 148 * If =lineno is not =NULL, the integer variable it points to is
Note: See TracChangeset
for help on using the changeset viewer.