]> git.sur5r.net Git - bacula/bacula/commitdiff
Ignore UTF-8 marker at the start of .conf files.
authorRobert Nelson <robertn@the-nelsons.org>
Wed, 1 Nov 2006 04:53:27 +0000 (04:53 +0000)
committerRobert Nelson <robertn@the-nelsons.org>
Wed, 1 Nov 2006 04:53:27 +0000 (04:53 +0000)
Add stab2cv to 3rd party dependencies.  This is a utility I wrote that is licensed under the GPL and available on SourceForge.  It converts the stab debugging info generated by gcc into Codeview format.  Currently it just translates function names to global symbols.  This is sufficient to get reasonable stack traces from Dr Watson and to look at minidumps.

Fix bug # 699 - winbacula client crashes whilerunning bat scripts.

Enable Windows XP look and feel for the tray icons and wx-console.

Add Windows specific FileSet example to bacula-dir.conf.

Reorganize Start menu so that documentation and configuration are in subfolders.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3589 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/lib/lex.c
bacula/src/lib/lex.h
bacula/src/lib/parse_conf.c

index 13b2cb9ab2a4ab1c0da93132631bf0a204797d7f..2fa93a7d13e5ea0fd4413d4b960f124c30265be7 100644 (file)
@@ -324,6 +324,7 @@ lex_get_token(LEX *lf, int expect)
    int ch;
    int token = T_NONE;
    bool esc_next = false;
+   int unicode_count = 0;
 
    Dmsg0(dbglvl, "enter lex_get_token\n");
    while (token == T_NONE) {
@@ -395,6 +396,16 @@ lex_get_token(LEX *lf, int expect)
             lf->state = lex_include;
             begin_str(lf, 0);
             break;
+         case 0xEF:
+            if (lf->line_no != 1 || lf->col_no != 1)
+            {
+               lf->state = lex_string;
+               begin_str(lf, ch);
+               break;
+            }
+            lf->state = lex_unicode_mark;
+            unicode_count = 1;
+            break;
          default:
             lf->state = lex_string;
             begin_str(lf, ch);
@@ -526,6 +537,27 @@ lex_get_token(LEX *lf, int expect)
          }
          add_str(lf, ch);
          break;
+      case lex_unicode_mark:
+         if (ch == L_EOF) {
+            token = T_ERROR;
+            break;
+         }
+         unicode_count++;
+         if (unicode_count == 2) {
+            if (ch != 0xBB) {
+               token = T_ERROR;
+               break;
+            }
+         } else if (unicode_count == 3) {
+            if (ch != 0xBF) {
+               token = T_ERROR;
+               break;
+            }
+            token = T_UNICODE_MARK;
+            lf->state = lex_none;
+            break;
+         }
+         break;
       }
       Dmsg4(dbglvl, "ch=%d state=%s token=%s %c\n", ch, lex_state_to_str(lf->state),
         lex_tok_to_str(token), ch);
index 1a05225d0ea65a003674a0f113edbe0ebbcaf70f..bf0bd1aac1be5ed11a920f096fc099048b788ed2 100644 (file)
@@ -46,6 +46,8 @@
 #define T_COMMA                       111
 #define T_EOL                         112
 #define T_ERROR                       200
+#define T_UNICODE_MARK                201
+
 /*
  * The following will be returned only if
  * the appropriate expect flag has been set
@@ -69,7 +71,8 @@ enum lex_state {
    lex_identifier,
    lex_string,
    lex_quoted_string,
-   lex_include
+   lex_include,
+   lex_unicode_mark
 };
 
 /* Lex scan options */
index fb18ada83cf6efb0b66cd25ad1c01ec874bfcaf3..b3f6804312fcc95c620a3e4838cbde1423179ae9 100755 (executable)
@@ -813,6 +813,9 @@ parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error, int err_type)
             if (token == T_EOL) {
                break;
             }
+            if (token == T_UNICODE_MARK) {
+               break;
+            }
             if (token != T_IDENTIFIER) {
                scan_err1(lc, _("Expected a Resource name identifier, got: %s"), lc->str);
                return 0;
@@ -827,7 +830,7 @@ parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error, int err_type)
                }
             if (state == p_none) {
                scan_err1(lc, _("expected resource name, got: %s"), lc->str);
-          return 0;
+               return 0;
             }
             break;
          case p_resource: