Staging
v0.5.1
https://github.com/git/git
Revision 5587cac28be66acf5edc2a4b83b67c8cfffbc5e9 authored by Junio C Hamano on 02 September 2007, 22:16:44 UTC, committed by Junio C Hamano on 03 September 2007, 08:28:37 UTC
HPA noticed that yum does not like the newer git RPM set; it turns out
that we do not ship git-p4 anymore but existing installations do not
realize the package is gone if we do not tell anything about it.

David Kastrup suggests using Obsoletes in the spec file of the new
RPM to replace the old package, so here is a try.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 030e0e5
Raw File
Tip revision: 5587cac28be66acf5edc2a4b83b67c8cfffbc5e9 authored by Junio C Hamano on 02 September 2007, 22:16:44 UTC
GIT 1.5.3.1: obsolete git-p4 in RPM spec file.
Tip revision: 5587cac
strbuf.c
#include "cache.h"
#include "strbuf.h"

void strbuf_init(struct strbuf *sb) {
	sb->buf = NULL;
	sb->eof = sb->alloc = sb->len = 0;
}

static void strbuf_begin(struct strbuf *sb) {
	free(sb->buf);
	strbuf_init(sb);
}

static void inline strbuf_add(struct strbuf *sb, int ch) {
	if (sb->alloc <= sb->len) {
		sb->alloc = sb->alloc * 3 / 2 + 16;
		sb->buf = xrealloc(sb->buf, sb->alloc);
	}
	sb->buf[sb->len++] = ch;
}

static void strbuf_end(struct strbuf *sb) {
	strbuf_add(sb, 0);
}

void read_line(struct strbuf *sb, FILE *fp, int term) {
	int ch;
	strbuf_begin(sb);
	if (feof(fp)) {
		sb->eof = 1;
		return;
	}
	while ((ch = fgetc(fp)) != EOF) {
		if (ch == term)
			break;
		strbuf_add(sb, ch);
	}
	if (ch == EOF && sb->len == 0)
		sb->eof = 1;
	strbuf_end(sb);
}
back to top