summaryrefslogtreecommitdiffstats
path: root/src/dialogs
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2008-03-22 08:30:18 +0000
committerjoncruz <joncruz@users.sourceforge.net>2008-03-22 08:30:18 +0000
commit521506b69ad48d4b65bf698f635f6e82b8e74829 (patch)
tree8f631a167cad78ac204539b4b7f324e5f5d3e2c4 /src/dialogs
parentset busy cursor and statusbar message while creating clones (diff)
downloadinkscape-521506b69ad48d4b65bf698f635f6e82b8e74829.tar.gz
inkscape-521506b69ad48d4b65bf698f635f6e82b8e74829.zip
Fixed skipping of blank lines in .gpl files
(bzr r5159)
Diffstat (limited to 'src/dialogs')
-rw-r--r--src/dialogs/swatches.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp
index 68e6fff0d..ea89be30f 100644
--- a/src/dialogs/swatches.cpp
+++ b/src/dialogs/swatches.cpp
@@ -842,7 +842,7 @@ void _loadPaletteFile( gchar const *filename )
while ( *ptr == ' ' || *ptr == '\t' ) {
ptr++;
}
- if ( *ptr == 0 ) {
+ if ( (*ptr == 0) || (*ptr == '\r') || (*ptr == '\n') ) {
// blank line. skip it.
} else if ( '0' <= *ptr && *ptr <= '9' ) {
// should be an entry link
@@ -948,7 +948,8 @@ static void loadEmUp()
while (!sources.empty()) {
gchar *dirname = sources.front();
- if ( Inkscape::IO::file_test( dirname, (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR) ) ) {
+ if ( Inkscape::IO::file_test( dirname, G_FILE_TEST_EXISTS )
+ && Inkscape::IO::file_test( dirname, G_FILE_TEST_IS_DIR )) {
GError *err = 0;
GDir *directory = g_dir_open(dirname, 0, &err);
if (!directory) {
@@ -961,7 +962,7 @@ static void loadEmUp()
gchar* lower = g_ascii_strdown( filename, -1 );
// if ( g_str_has_suffix(lower, ".gpl") ) {
gchar* full = g_build_filename(dirname, filename, NULL);
- if ( !Inkscape::IO::file_test( full, (GFileTest)(G_FILE_TEST_IS_DIR ) ) ) {
+ if ( !Inkscape::IO::file_test( full, G_FILE_TEST_IS_DIR ) ) {
_loadPaletteFile(full);
}
g_free(full);