Fossil SCM

One more thing I spotted (but cannot test!): UTF8-mac encoded values could enter fossil through environment variables as well...

jan.nijtmans 2012-11-29 09:59 UTC ticket-e399bc
Commit 42951c59ae7191100c484a89ad56970717cd77cc
1 file changed +1 -1
+1 -1
--- src/file.c
+++ src/file.c
@@ -1100,14 +1100,14 @@
11001100
char *fossil_getenv(const char *zName){
11011101
#ifdef _WIN32
11021102
wchar_t *uName = fossil_utf8_to_unicode(zName);
11031103
void *zValue = _wgetenv(uName);
11041104
fossil_unicode_free(uName);
1105
- if( zValue ) zValue = fossil_filename_to_utf8(zValue);
11061105
#else
11071106
char *zValue = getenv(zName);
11081107
#endif
1108
+ if( zValue ) zValue = fossil_filename_to_utf8(zValue);
11091109
return zValue;
11101110
}
11111111
11121112
/*
11131113
** Like fopen() but always takes a UTF8 argument.
11141114
--- src/file.c
+++ src/file.c
@@ -1100,14 +1100,14 @@
1100 char *fossil_getenv(const char *zName){
1101 #ifdef _WIN32
1102 wchar_t *uName = fossil_utf8_to_unicode(zName);
1103 void *zValue = _wgetenv(uName);
1104 fossil_unicode_free(uName);
1105 if( zValue ) zValue = fossil_filename_to_utf8(zValue);
1106 #else
1107 char *zValue = getenv(zName);
1108 #endif
 
1109 return zValue;
1110 }
1111
1112 /*
1113 ** Like fopen() but always takes a UTF8 argument.
1114
--- src/file.c
+++ src/file.c
@@ -1100,14 +1100,14 @@
1100 char *fossil_getenv(const char *zName){
1101 #ifdef _WIN32
1102 wchar_t *uName = fossil_utf8_to_unicode(zName);
1103 void *zValue = _wgetenv(uName);
1104 fossil_unicode_free(uName);
 
1105 #else
1106 char *zValue = getenv(zName);
1107 #endif
1108 if( zValue ) zValue = fossil_filename_to_utf8(zValue);
1109 return zValue;
1110 }
1111
1112 /*
1113 ** Like fopen() but always takes a UTF8 argument.
1114

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button