+void SaveSetup_AutoSetup()
+{
+ char *filename = getPath2(getSetupDir(), AUTOSETUP_FILENAME);
+ FILE *file;
+ int i;
+
+ InitUserDataDirectory();
+
+ if (!(file = fopen(filename, MODE_WRITE)))
+ {
+ Error(ERR_WARN, "cannot write auto setup file '%s'", filename);
+ free(filename);
+ return;
+ }
+
+ fprintFileHeader(file, AUTOSETUP_FILENAME);
+
+ sasi = setup.auto_setup;
+ for (i = 0; i < NUM_AUTO_SETUP_TOKENS; i++)
+ fprintf(file, "%s\n", getSetupLine(auto_setup_tokens, "", i));
+
+ fclose(file);
+
+ SetFilePermissions(filename, PERMS_PRIVATE);
+
+ free(filename);
+}
+