]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/lex.c
Fix get_basename() -- rewrite
[bacula/bacula] / bacula / src / lib / lex.c
index 03b64ac0d23498426259807bbc5a9c9bd7756be5..4e2558a8b07abcd9bf2c3dbcc4f0229d2a957a63 100644 (file)
@@ -1,12 +1,12 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -30,8 +30,6 @@
  *
  *   Kern Sibbald, 2000
  *
- *   Version $Id$
- *
  */
 
 #include "bacula.h"
@@ -454,8 +452,14 @@ lex_get_token(LEX *lf, int expect)
             }
             break;
          case '@':
-            lf->state = lex_include;
-            begin_str(lf, 0);
+            /* In NO_EXTERN mode, @ is part of a string */
+            if (lf->options & LOPT_NO_EXTERN) {
+               lf->state = lex_string;
+               begin_str(lf, ch);
+            } else {
+               lf->state = lex_include;
+               begin_str(lf, 0);
+            }
             break;
          case 0xEF: /* probably a UTF-8 BOM */
          case 0xFF: /* probably a UTF-16le BOM */