mercurial/cext/manifest.c
changeset 40601 da4478ca0e32
parent 40600 f27f8e9ef1e7
child 40765 7e6834ade51d
equal deleted inserted replaced
40600:f27f8e9ef1e7 40601:da4478ca0e32
   135 			   so we can give up here.
   135 			   so we can give up here.
   136 			*/
   136 			*/
   137 			return MANIFEST_TOO_SHORT_LINE;
   137 			return MANIFEST_TOO_SHORT_LINE;
   138 		}
   138 		}
   139 		next++; /* advance past newline */
   139 		next++; /* advance past newline */
   140 		if (!realloc_if_full(self)) {
       
   141 			return MANIFEST_OOM; /* no memory */
       
   142 		}
       
   143 		if (prev && strcmp(prev, data) > -1) {
   140 		if (prev && strcmp(prev, data) > -1) {
   144 			/* This data isn't sorted, so we have to abort. */
   141 			/* This data isn't sorted, so we have to abort. */
   145 			return MANIFEST_NOT_SORTED;
   142 			return MANIFEST_NOT_SORTED;
       
   143 		}
       
   144 		if (!realloc_if_full(self)) {
       
   145 			return MANIFEST_OOM; /* no memory */
   146 		}
   146 		}
   147 		l = self->lines + ((self->numlines)++);
   147 		l = self->lines + ((self->numlines)++);
   148 		l->start = data;
   148 		l->start = data;
   149 		l->len = next - data;
   149 		l->len = next - data;
   150 		l->hash_suffix = '\0';
   150 		l->hash_suffix = '\0';