summaryrefslogtreecommitdiff
path: root/source/q_shared.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-05-09 18:04:42 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-05-09 18:04:42 +0000
commit026b51719172c865bc8fefe7ffd63cc79c74db1c (patch)
tree559947ebd3f8f0ba000bd72f927dc337430c38c6 /source/q_shared.c
parent89e431fa54b292ff1ebd5346c06e733cdb710bd9 (diff)
Autodetect gzipped demos during playback.
Extended menu scripts.
Diffstat (limited to 'source/q_shared.c')
-rw-r--r--source/q_shared.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source/q_shared.c b/source/q_shared.c
index 2e6b523..3fb40fb 100644
--- a/source/q_shared.c
+++ b/source/q_shared.c
@@ -719,10 +719,10 @@ char *COM_SkipPath( const char *pathname ) {
COM_StripExtension
============
*/
-void COM_StripExtension( const char *in, char *out, int outSize ) {
+void COM_StripExtension( const char *in, char *out, size_t size ) {
char *s;
- Q_strncpyz( out, in, outSize );
+ Q_strncpyz( out, in, size );
s = out + strlen( out );
@@ -801,7 +801,7 @@ COM_FilePath
Returns the path up to, but not including the last /
============
*/
-void COM_FilePath( const char *in, char *out, int size ) {
+void COM_FilePath( const char *in, char *out, size_t size ) {
char *s;
Q_strncpyz( out, in, size );
@@ -819,7 +819,7 @@ void COM_FilePath( const char *in, char *out, int size ) {
COM_DefaultExtension
==================
*/
-void COM_DefaultExtension( char *path, const char *extension, int pathSize ) {
+void COM_DefaultExtension( char *path, const char *ext, size_t size ) {
char *src;
//
// if path doesn't have a .EXT, append extension
@@ -835,12 +835,12 @@ void COM_DefaultExtension( char *path, const char *extension, int pathSize ) {
}
}
- Q_strcat( path, pathSize, extension );
+ Q_strcat( path, size, ext );
}
-void COM_AppendExtension( char *path, const char *extension, int pathSize ) {
- if( Q_stricmp( COM_FileExtension( path ), extension ) ) {
- Q_strcat( path, pathSize, extension );
+void COM_AppendExtension( char *path, const char *ext, size_t size ) {
+ if( Q_stricmp( COM_FileExtension( path ), ext ) ) {
+ Q_strcat( path, size, ext );
}
}
@@ -1782,6 +1782,12 @@ int COM_Compress( char *data ) {
continue;
}
+ // handle line feed escape
+ if( *s == '\\' && s[1] == '\n' ) {
+ s += 2;
+ continue;
+ }
+
// parse a regular word
do {
*d++ = *s++;