[or-cvs] make it clearer in the auto-generated config file that you

arma at seul.org arma at seul.org
Tue Dec 27 02:46:56 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	config.c 
Log Message:
make it clearer in the auto-generated config file that you
probably shouldn't be editing this one yourself.


Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.466
retrieving revision 1.467
diff -u -p -d -r1.466 -r1.467
--- config.c	23 Dec 2005 23:56:42 -0000	1.466
+++ config.c	27 Dec 2005 02:46:53 -0000	1.467
@@ -3191,6 +3191,8 @@ validate_data_directory(or_options_t *op
 
 #define GENERATED_FILE_PREFIX "# This file was generated by Tor; " \
   "if you edit it, comments will not be preserved"
+#define GENERATED_FILE_COMMENT "# If you want a config file with " \
+  "comments, look for torrc.orig.1 or similar"
 
 /** Save a configuration file for the configuration in <b>options</b>
  * into the file <b>fname</b>.  If the file already exists, and
@@ -3225,9 +3227,10 @@ write_configuration_file(const char *fna
     goto err;
   }
 
-  len = strlen(new_conf)+128;
+  len = strlen(new_conf)+256;
   new_val = tor_malloc(len);
-  tor_snprintf(new_val, len, "%s\n\n%s", GENERATED_FILE_PREFIX, new_conf);
+  tor_snprintf(new_val, len, "%s\n%s\n\n%s",
+               GENERATED_FILE_PREFIX, GENERATED_FILE_COMMENTS, new_conf);
 
   if (rename_old) {
     int i = 1;



More information about the tor-commits mailing list