Revision 1b9ddce8cfd0719ac02c44a2255db8420dfbea4c authored by Kevin Goess on 20 March 2015, 18:47:42 UTC, committed by Kevin Goess on 20 March 2015, 18:47:42 UTC
The context-lines selectbox wasn't displaying for a combination of url
parameters that look like this:

     w=1;a=commitdiff;hp=80b5760;h=c6e2782

it was just generating a navbar like this:

    raw (from: 80b5760)

Fixing that case to also have the context-lines selectbox.
1 parent cd43ac7
Raw File
version.c
#include "git-compat-util.h"
#include "version.h"
#include "strbuf.h"

const char git_version_string[] = GIT_VERSION;

const char *git_user_agent(void)
{
	static const char *agent = NULL;

	if (!agent) {
		agent = getenv("GIT_USER_AGENT");
		if (!agent)
			agent = GIT_USER_AGENT;
	}

	return agent;
}

const char *git_user_agent_sanitized(void)
{
	static const char *agent = NULL;

	if (!agent) {
		struct strbuf buf = STRBUF_INIT;
		int i;

		strbuf_addstr(&buf, git_user_agent());
		strbuf_trim(&buf);
		for (i = 0; i < buf.len; i++) {
			if (buf.buf[i] <= 32 || buf.buf[i] >= 127)
				buf.buf[i] = '.';
		}
		agent = buf.buf;
	}

	return agent;
}
back to top