[vlc-commits] commit: Do not put copyright statement where it does not belong ( Rémi Denis-Courmont )
git at videolan.org
git at videolan.org
Sat Mar 13 18:32:37 CET 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Mar 13 19:28:53 2010 +0200| [c95e19193d2e37539bcb56eb3c601f9c831a6028] | committer: Rémi Denis-Courmont
Do not put copyright statement where it does not belong
* plugin cache identifier string,
* HTTP user agent header,
* configuration file head comment,
* CGI server software name.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c95e19193d2e37539bcb56eb3c601f9c831a6028
---
modules/access/http.c | 4 ++--
modules/control/http/http.c | 2 +-
src/config/file.c | 11 +++++++++--
src/modules/cache.c | 9 +++++----
4 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/modules/access/http.c b/modules/access/http.c
index 8ddcf5c..3fb72e5 100644
--- a/modules/access/http.c
+++ b/modules/access/http.c
@@ -123,8 +123,8 @@ vlc_module_begin ()
add_integer( "http-caching", 4 * DEFAULT_PTS_DELAY / 1000, NULL,
CACHING_TEXT, CACHING_LONGTEXT, true )
change_safe()
- add_string( "http-user-agent", COPYRIGHT_MESSAGE , NULL, AGENT_TEXT,
- AGENT_LONGTEXT, true )
+ add_string( "http-user-agent", PACKAGE_NAME" "PACKAGE_VERSION, NULL,
+ AGENT_TEXT, AGENT_LONGTEXT, true )
change_safe()
add_bool( "http-reconnect", false, NULL, RECONNECT_TEXT,
RECONNECT_LONGTEXT, true )
diff --git a/modules/control/http/http.c b/modules/control/http/http.c
index 7dc3a77..bd6de15 100644
--- a/modules/control/http/http.c
+++ b/modules/control/http/http.c
@@ -550,7 +550,7 @@ int HandlerCallback( httpd_handler_sys_t *p_args,
/* Create environment for the CGI */
TAB_APPEND( i_env, ppsz_env, strdup("GATEWAY_INTERFACE=CGI/1.1") );
TAB_APPEND( i_env, ppsz_env, strdup("SERVER_PROTOCOL=HTTP/1.1") );
- TAB_APPEND( i_env, ppsz_env, strdup("SERVER_SOFTWARE=" COPYRIGHT_MESSAGE) );
+ TAB_APPEND( i_env, ppsz_env, strdup("SERVER_SOFTWARE=VLC "VERSION) );
switch( i_type )
{
diff --git a/src/config/file.c b/src/config/file.c
index 25043c4..3cec082 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -559,8 +559,15 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
goto error;
}
- fprintf( file, "\xEF\xBB\xBF###\n### " COPYRIGHT_MESSAGE "\n###\n\n"
- "###\n### lines beginning with a '#' character are comments\n###\n\n" );
+ fprintf( file,
+ "\xEF\xBB\xBF###\n"
+ "### "PACKAGE_NAME" "PACKAGE_VERSION"\n"
+ "###\n"
+ "\n"
+ "###\n"
+ "### lines beginning with a '#' character are comments\n"
+ "###\n"
+ "\n" );
/* Ensure consistent number formatting... */
locale_t loc = newlocale (LC_NUMERIC_MASK, "C", NULL);
diff --git a/src/modules/cache.c b/src/modules/cache.c
index c699711..c6e314f 100644
--- a/src/modules/cache.c
+++ b/src/modules/cache.c
@@ -67,6 +67,7 @@ static int CacheLoadConfig ( module_t *, FILE * );
/* Magic for the cache filename */
#define CACHENAME_VALUES \
sizeof(int), sizeof(void *), *(uint8_t *)&(uint16_t){ 0xbe1e }, vlc_CPU()
+#define CACHE_STRING "cache "PACKAGE_NAME" "PACKAGE_VERSION
void CacheDelete( vlc_object_t *obj, const char *dir )
@@ -96,7 +97,7 @@ void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, const char *dir )
char *psz_filename;
FILE *file;
int j, i_size, i_read;
- char p_cachestring[sizeof("cache " COPYRIGHT_MESSAGE)];
+ char p_cachestring[sizeof(CACHE_STRING)];
size_t i_cache;
module_cache_t **pp_cache = NULL;
int32_t i_file_size, i_marker;
@@ -143,10 +144,10 @@ void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, const char *dir )
fseek( file, sizeof(i_file_size), SEEK_SET );
/* Check the file is a plugins cache */
- i_size = sizeof("cache " COPYRIGHT_MESSAGE) - 1;
+ i_size = sizeof(CACHE_STRING) - 1;
i_read = fread( p_cachestring, 1, i_size, file );
if( i_read != i_size ||
- memcmp( p_cachestring, "cache " COPYRIGHT_MESSAGE, i_size ) )
+ memcmp( p_cachestring, CACHE_STRING, i_size ) )
{
msg_Warn( p_this, "This doesn't look like a valid plugins cache" );
fclose( file );
@@ -498,7 +499,7 @@ static int CacheSaveBank (FILE *file, module_cache_t *const *pp_cache,
goto error;
/* Contains version number */
- if (fputs ("cache "COPYRIGHT_MESSAGE, file) == EOF)
+ if (fputs (CACHE_STRING, file) == EOF)
goto error;
#ifdef DISTRO_VERSION
/* Allow binary maintaner to pass a string to detect new binary version*/
More information about the vlc-commits
mailing list