summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 776ffb5)
raw | patch | inline | side by side (parent: 776ffb5)
author | pjrm <pjrm@users.sourceforge.net> | |
Sun, 5 Apr 2009 22:54:04 +0000 (22:54 +0000) | ||
committer | pjrm <pjrm@users.sourceforge.net> | |
Sun, 5 Apr 2009 22:54:04 +0000 (22:54 +0000) |
src/xml/repr-io.cpp | patch | blob | history |
diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp
index e503540bbee7841ea3f94215b7831896161ede12..b9d0816c8519bb4bab9d1e0d41c10cc35dddc9a9 100644 (file)
--- a/src/xml/repr-io.cpp
+++ b/src/xml/repr-io.cpp
@@ -599,24 +599,18 @@ sp_repr_save_stream (Document *doc, FILE *fp, gchar const *default_ns, bool comp
/* Returns TRUE if file successfully saved; FALSE if not
*/
bool
-sp_repr_save_file (Document *doc, const gchar *filename,
+sp_repr_save_file (Document *doc, gchar const *filename,
gchar const *default_ns)
{
if (filename == NULL) {
return FALSE;
}
- bool compress = false;
+
+ bool compress;
{
- if (strlen (filename) > 5) {
- gchar tmp[] = {0,0,0,0,0,0};
- strncpy( tmp, filename + strlen (filename) - 5, 6 );
- tmp[5] = 0;
- if ( strcasecmp(".svgz", tmp ) == 0 )
- {
- //g_message("TIME TO COMPRESS THE OUTPUT FOR SVGZ");
- compress = true;
- }
- }
+ size_t const filename_len = strlen(filename);
+ compress = ( filename_len > 5
+ && strcasecmp(".svgz", filename + filename_len - 5) == 0 );
}
Inkscape::IO::dump_fopen_call( filename, "B" );