aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-04-16 23:56:31 +0000
committerNick Mathewson <nickm@torproject.org>2007-04-16 23:56:31 +0000
commitbfac679cd4209ea441211bcb5c5e210c6264e8c7 (patch)
tree541e482d67428e9c0015a4cd358ca9961f4413a8 /src/or/config.c
parent362fbc79d276864c4b2b68ed9cf3bb8ba534985e (diff)
downloadtor-bfac679cd4209ea441211bcb5c5e210c6264e8c7.tar
tor-bfac679cd4209ea441211bcb5c5e210c6264e8c7.tar.gz
A hack I've been wanting for a while: when building a -dev version
from an SVN repository, use the current svn revision in the platform string and in the output of --version. svn:r9976
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index c7b7fdf24..568cd934b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2982,6 +2982,8 @@ check_nickname_list(const char *lst, const char *name, char **msg)
return r;
}
+extern const char tor_svn_revision[]; /* from main.c */
+
/** Read a configuration file into <b>options</b>, finding the configuration
* file location based on the command line. After loading the options,
* validate them for consistency, then take actions based on them.
@@ -3018,7 +3020,13 @@ options_init_from_torrc(int argc, char **argv)
}
if (argc > 1 && (!strcmp(argv[1],"--version"))) {
- printf("Tor version %s.\n",VERSION);
+ char vbuf[128];
+ if (tor_svn_revision && strlen(tor_svn_revision)) {
+ tor_snprintf(vbuf, sizeof(vbuf), " (r%s)", tor_svn_revision);
+ } else {
+ vbuf[0] = 0;
+ }
+ printf("Tor version %s%s.\n",VERSION,vbuf);
if (argc > 2 && (!strcmp(argv[2],"--version"))) {
print_svn_version();
}