[tor-commits] [obfsproxy/master] Fix '--version' when called outside of a git repository.

asn at torproject.org asn at torproject.org
Thu Apr 12 21:14:29 UTC 2012


commit 8b53ef32f626229db8c4ac860733f75b00d66112
Author: George Kadianakis <desnacked at riseup.net>
Date:   Mon Apr 9 16:53:19 2012 +0200

    Fix '--version' when called outside of a git repository.
    
    Also, have '--version' output the release name and not just the git
    hash.
---
 ChangeLog  |    5 +++++
 src/main.c |    6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2a7605c..a818f34 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Changes in version 0.1.4 - <not yet released>
+ - Fix 'obfsproxy --version' when called outside of a git
+   repository. Fixes bug 5560.
+
+
 Changes in version 0.1.3 - 2012-04-03
  - Display git revision when we start logging. Fixes part of bug
    #5157.
diff --git a/src/main.c b/src/main.c
index 30210f1..c78ee0e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -59,9 +59,9 @@ get_version(void)
 {
   if (!the_obfsproxy_version) {
     if (strlen(obfs_git_revision))
-      obfs_asprintf(&the_obfsproxy_version, "git-%s", obfs_git_revision);
+      obfs_asprintf(&the_obfsproxy_version, "%s (git-%s)", VERSION, obfs_git_revision);
     else
-      obfs_asprintf(&the_obfsproxy_version, "git");
+      the_obfsproxy_version = xstrdup(VERSION);
   }
 
   return the_obfsproxy_version;
@@ -337,7 +337,7 @@ obfs_main(int argc, const char *const *argv)
 
   /* Handle optional obfsproxy arguments. */
   begin = argv + handle_obfsproxy_args(argv);
-  log_notice("Starting (%s).", get_version());
+  log_notice("Starting (obfsproxy version: %s).", get_version());
 
   if (is_external_proxy) {
     if (launch_external_proxy(begin) < 0)



More information about the tor-commits mailing list