summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@gnome.org>2003-12-27 17:48:12 +0000
committerDodji Seketeli <dodji@src.gnome.org>2003-12-27 17:48:12 +0000
commit0770337b2b35ea9ece19ef37de8efcb9cc828e99 (patch)
tree4a62cd48c82e6f325df88f8f9effd929c259260a
parentd502de118110eccf135cca563f8c535759f743e4 (diff)
downloadlibcroco-0770337b2b35ea9ece19ef37de8efcb9cc828e99.tar.gz
did some fixes/cleanup here. Make sure csslint --help shows a proper help.
2003-12-27 Dodji Seketeli <dodji@gnome.org> * csslint/csslint.c: did some fixes/cleanup here. Make sure csslint --help shows a proper help. * src/parser/cr-statement.c: (cr_statement_dump): when a NULL statement is given, do not dump anything, instead considering this as an error. * src/parser/cr-stylesheet.c: (cr_stylesheet_dump): give the possibility to dump empty sheets, instead of considering this case as an error case.
-rw-r--r--ChangeLog12
-rw-r--r--csslint/csslint.c14
-rw-r--r--src/parser/cr-parser.c5
-rw-r--r--src/parser/cr-statement.c4
-rw-r--r--src/parser/cr-stylesheet.c4
-rw-r--r--src/parser/cr-utils.c2
6 files changed, 33 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 308d533..7ce345f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2003-12-27 Dodji Seketeli <dodji@gnome.org>
+
+ * csslint/csslint.c: did some fixes/cleanup here.
+ Make sure csslint --help shows a proper help.
+ * src/parser/cr-statement.c:
+ (cr_statement_dump): when a NULL statement is given, do
+ not dump anything, instead considering this as an error.
+ * src/parser/cr-stylesheet.c:
+ (cr_stylesheet_dump): give the possibility to dump
+ empty sheets, instead of considering this case as
+ an error case.
+
2003-12-24 Dodji Seketeli <dodji@gnome.org>
* src/parser/cr-additional-sel.h,src/parser/cr-pseudo.h,
diff --git a/csslint/csslint.c b/csslint/csslint.c
index a39a3fd..a44ed2c 100644
--- a/csslint/csslint.c
+++ b/csslint/csslint.c
@@ -36,7 +36,7 @@ struct Options
{
gboolean show_version ;
gboolean use_cssom ;
-
+ gboolean display_help ;
gchar ** files_list ;
};
@@ -86,6 +86,11 @@ csslint_parse_cmd_line (int a_argc, char **a_argv,
{
a_options->use_cssom = TRUE ;
}
+ if (!strcmp (a_argv[i], "--help") ||
+ !strcmp (a_argv[i], "-h"))
+ {
+ a_options->display_help = TRUE ;
+ }
}
if (i >= a_argc)
@@ -190,6 +195,11 @@ main (int argc, char **argv)
return 0;
}
+ if (options.display_help == TRUE)
+ {
+ csslint_usage (argv[0]) ;
+ return 0 ;
+ }
if (options.use_cssom == TRUE)
{
if (options.files_list != NULL)
@@ -200,7 +210,7 @@ main (int argc, char **argv)
}
else
{
- csslint_show_version(argv[0]);
+ csslint_usage (argv[0]);
return 0;
}
diff --git a/src/parser/cr-parser.c b/src/parser/cr-parser.c
index d6252a5..c580799 100644
--- a/src/parser/cr-parser.c
+++ b/src/parser/cr-parser.c
@@ -176,7 +176,7 @@ if ((status) != CR_OK) \
*on the parser error stack when an error arises.
*@param a_this the current instance of #CRParser .
*@param a_status the status to check. Is of type enum #CRStatus.
- *@param a_is_exception in case of error, if is FALSE, the status
+ *@param a_is_exception in case of error, if is TRUE, the status
*is set to CR_PARSING_ERROR before goto error. If is false, the
*real low level status is kept and will be returned by the
*upper level function that called this macro. Usally,this must
@@ -4001,7 +4001,7 @@ cr_parser_parse_ruleset (CRParser *a_this)
}
}
- CHECK_PARSING_STATUS_ERR
+ CHECK_PARSING_STATUS_ERR
(a_this, status, FALSE,
"while parsing ruleset: next construction should be a declaration",
CR_SYNTAX_ERROR) ;
@@ -4018,6 +4018,7 @@ cr_parser_parse_ruleset (CRParser *a_this)
status = cr_parser_parse_declaration (a_this, &property,
&expr) ;
+
if (expr)
{
cr_term_ref (expr) ;
diff --git a/src/parser/cr-statement.c b/src/parser/cr-statement.c
index 88ef9c0..a857680 100644
--- a/src/parser/cr-statement.c
+++ b/src/parser/cr-statement.c
@@ -2303,7 +2303,9 @@ cr_statement_at_font_face_rule_add_decl (CRStatement *a_this,
void
cr_statement_dump (CRStatement *a_this, FILE *a_fp, gulong a_indent)
{
- g_return_if_fail (a_this) ;
+
+ if (!a_this)
+ return ;
if (a_this->prev)
{
diff --git a/src/parser/cr-stylesheet.c b/src/parser/cr-stylesheet.c
index 4b3cba6..06b1c5f 100644
--- a/src/parser/cr-stylesheet.c
+++ b/src/parser/cr-stylesheet.c
@@ -3,7 +3,7 @@
/*
* This file is part of The Croco Library
*
- * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
+ * Copyright (C) 2002-2003 Dodji Seketeli <dodji seketeli.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2.1 of the GNU Lesser General Public
@@ -68,7 +68,7 @@ cr_stylesheet_dump (CRStyleSheet *a_this, FILE *a_fp)
{
CRStatement * cur_stmt = NULL ;
- g_return_if_fail (a_this && a_this->statements) ;
+ g_return_if_fail (a_this) ;
for (cur_stmt = a_this->statements ;
cur_stmt ;
diff --git a/src/parser/cr-utils.c b/src/parser/cr-utils.c
index cbc4593..4c7c00a 100644
--- a/src/parser/cr-utils.c
+++ b/src/parser/cr-utils.c
@@ -3,7 +3,7 @@
/*
* This file is part of The Croco Library
*
- * Copyright (C) 2002-2003 Dodji Seketeli <dodji@seketeli.org>
+ * Copyright (C) 2002-2003 Dodji Seketeli <dodji at seketeli.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2.1 of the GNU Lesser General Public