Debian Codegraph @

libdebugger/command/chdir.c

raw symbols SCIP
1 /* Write commands associated with a given target. */
2 /*
3 Copyright (C) 2011, 2020 R. Bernstein <[email protected]>
4 This file is part of GNU Make (remake variant).
5
6 GNU Make is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU Make is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Make; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 /** \file libdebugger/command/chdir.c
22 *
23 * \brief Debugger `chdir` command.
24 *
25 * Debugger command to set working directory to `dir`.
26 */
27
28 #include "../../src/trace.h"
29
30 extern debug_return_t
31 dbg_cmd_chdir (char *psz_args)
32 {
33 if (!psz_args || 0==strlen(psz_args)) {
34 printf(_("Argument required (new working directory).\n"));
35 } else {
36 if ( 0 != chdir(psz_args) ) {
37 printf("%s: %s\n", psz_args, strerror(1));
38 } else {
39 printf (_("Working directory %s.\n"), psz_args);
40 }
41 }
42 return debug_readloop;
43 }
44
45 /*
46 * Local variables:
47 * eval: (c-set-style "gnu")
48 * indent-tabs-mode: nil
49 * End:
50 */