Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-03-14 20:18:36 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-03-14 20:18:36 +0300
commite3c746659e378d5e739f97a9256cbfe1fdec6fee (patch)
treee8cd2bfd88ab1b24c8fcd6508e5536c76f77c918 /source/creator
parent128ecc7e822cdc989175a348edcc20f6858d6805 (diff)
strip quites off buildinfo at startup (was doing this for splash screen and python api)
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/buildinfo.c10
-rw-r--r--source/creator/creator.c32
2 files changed, 31 insertions, 11 deletions
diff --git a/source/creator/buildinfo.c b/source/creator/buildinfo.c
index d50a99e8850..8b02dde1a5f 100644
--- a/source/creator/buildinfo.c
+++ b/source/creator/buildinfo.c
@@ -35,9 +35,9 @@
#define XSTRINGIFY(x) #x
#ifdef BUILD_DATE
-const char * build_date=STRINGIFY(BUILD_DATE);
-const char * build_time=STRINGIFY(BUILD_TIME);
-const char * build_rev=STRINGIFY(BUILD_REV);
-const char * build_platform=STRINGIFY(BUILD_PLATFORM);
-const char * build_type=STRINGIFY(BUILD_TYPE);
+char build_date[]= STRINGIFY(BUILD_DATE);
+char build_time[]= STRINGIFY(BUILD_TIME);
+char build_rev[]= STRINGIFY(BUILD_REV);
+char build_platform[]= STRINGIFY(BUILD_PLATFORM);
+char build_type[]= STRINGIFY(BUILD_TYPE);
#endif
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 9e910b7cad2..91b4ed09b40 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -107,11 +107,11 @@
// from buildinfo.c
#ifdef BUILD_DATE
-extern const char * build_date;
-extern const char * build_time;
-extern const char * build_rev;
-extern const char * build_platform;
-extern const char * build_type;
+extern char build_date[];
+extern char build_time[];
+extern char build_rev[];
+extern char build_platform[];
+extern char build_type[];
#endif
/* Local Function prototypes */
@@ -161,6 +161,18 @@ static void blender_esc(int sig)
}
}
+/* buildinfo can have quotes */
+static void strip_quotes(char *str)
+{
+ if(str[0] == '"') {
+ int len= strlen(str) - 1;
+ memmove(str, str+1, len);
+ if(str[len-1] == '"') {
+ str[len-1]= '\0';
+ }
+ }
+}
+
static int print_version(int argc, char **argv, void *data)
{
#ifdef BUILD_DATE
@@ -936,7 +948,15 @@ int main(int argc, char **argv)
if(blender_path_env)
BLI_strncpy(blender_path, blender_path_env, sizeof(blender_path));
}
-
+
+#ifdef BUILD_DATE
+ strip_quotes(build_date);
+ strip_quotes(build_time);
+ strip_quotes(build_rev);
+ strip_quotes(build_platform);
+ strip_quotes(build_type);
+#endif
+
RNA_init();
RE_engines_init();