shouldn't need these overrides any more
[debian/amanda] / recover-src / uparse.y
index 35d6d3e43162221058007dcfc3fd8f7a8b617248..72ae6eb784e8475abd16a989993413c6a5ba2c7d 100644 (file)
@@ -48,8 +48,8 @@ extern char * yytext;
 
        /* literal keyword tokens */
 
-%token LISTHOST LISTDISK SETHOST SETDISK SETDATE SETTAPE SETMODE
-%token CD CDX QUIT DHIST LS ADD ADDX EXTRACT
+%token LISTHOST LISTDISK SETHOST SETDISK SETDATE SETTAPE SETMODE SETDEVICE
+%token CD CDX QUIT DHIST LS ADD ADDX EXTRACT DASH_H
 %token LIST DELETE DELETEX PWD CLEAR HELP LCD LPWD MODE SMB TAR
 
         /* typed tokens */
@@ -89,7 +89,10 @@ set_command:
   |     SETDISK PATH PATH { set_disk($2, $3); amfree($2); amfree($3); }
   |     SETDISK PATH { set_disk($2, NULL); amfree($2); }
   |     SETTAPE PATH { set_tape($2); amfree($2); }
-  |     SETTAPE { set_tape(""); }
+  |     SETTAPE { set_tape("default"); }
+  |    SETDEVICE PATH { set_device(NULL, $2); }
+  |    SETDEVICE DASH_H PATH PATH { set_device($3, $4); }
+  |    SETDEVICE { set_device(NULL, NULL); }
   |     CD PATH { cd_glob($2); amfree($2); }
   |     CDX PATH { cd_regex($2); amfree($2); }
   |     SETMODE SMB {
@@ -155,11 +158,9 @@ deletex_path:
   ;
 
 local_command:
-       LPWD { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
+       LPWD { char * buf= g_get_current_dir(); puts(buf); free(buf); }
   |     LCD PATH {
-               if (chdir($2) == -1) {
-                       perror($2);
-               }
+               local_cd($2);
                amfree($2);
        }
   ;
@@ -179,5 +180,5 @@ void
 yyerror(
     char *     s)
 {
-       printf("%s\n", s);
+       g_printf("%s\n", s);
 }