lexer: Get rid of lex_negative_to_dash().
[pspp] / src / language / utilities / permissions.c
index 03458fcef01671f4ea4b263873ff89ebe86a7a2b..34fa6fd83defb8701b97c9d505f3da22100c0ed4 100644 (file)
@@ -15,7 +15,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 #include <config.h>
-#include <libpspp/message.h>
+
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -42,21 +42,24 @@ cmd_permissions (struct lexer *lexer, struct dataset *ds UNUSED)
 {
   char  *fn = 0;
 
-  lex_match (lexer, '/');
+  lex_match (lexer, T_SLASH);
 
   if (lex_match_id (lexer, "FILE"))
-    lex_match (lexer, '=');
+    lex_match (lexer, T_EQUALS);
+
+  if (!lex_force_string (lexer))
+    return CMD_FAILURE;
 
   fn = ds_xstrdup (lex_tokstr (lexer));
   lex_force_match (lexer, T_STRING);
 
 
-  lex_match (lexer, '/');
+  lex_match (lexer, T_SLASH);
 
   if ( ! lex_match_id (lexer, "PERMISSIONS"))
     goto error;
 
-  lex_match (lexer, '=');
+  lex_match (lexer, T_EQUALS);
 
   if ( lex_match_id (lexer, "READONLY"))
     {