diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:36:23 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2023-02-08 15:46:02 -0500 |
commit | c583a2520616c2736cffc389c89a48b159366e6c (patch) | |
tree | b4925f26506fcee96c16119431c01760f05db95d /gdbsupport/gdb_tilde_expand.cc | |
parent | ca7f92c2f15b86b09c4a8ad14806bef666308d31 (diff) | |
download | gdb-users/simark/clang-format.zip gdb-users/simark/clang-format.tar.gz gdb-users/simark/clang-format.tar.bz2 |
Run clang-format.shusers/simark/clang-format
Change-Id: Ia948cc26d534b0dd02702244d52434b1a2093968
Diffstat (limited to 'gdbsupport/gdb_tilde_expand.cc')
-rw-r--r-- | gdbsupport/gdb_tilde_expand.cc | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/gdbsupport/gdb_tilde_expand.cc b/gdbsupport/gdb_tilde_expand.cc index d6bdb87..b8814a9 100644 --- a/gdbsupport/gdb_tilde_expand.cc +++ b/gdbsupport/gdb_tilde_expand.cc @@ -31,37 +31,27 @@ public: /* Construct a "gdb_glob" object by calling "glob" with the provided parameters. This function can throw if "glob" fails. */ gdb_glob (const char *pattern, int flags, - int (*errfunc) (const char *epath, int eerrno)) + int (*errfunc) (const char *epath, int eerrno)) { int ret = glob (pattern, flags, errfunc, &m_glob); if (ret != 0) { - if (ret == GLOB_NOMATCH) - error (_("Could not find a match for '%s'."), pattern); - else - error (_("glob could not process pattern '%s'."), - pattern); + if (ret == GLOB_NOMATCH) + error (_ ("Could not find a match for '%s'."), pattern); + else + error (_ ("glob could not process pattern '%s'."), pattern); } } /* Destroy the object and free M_GLOB. */ - ~gdb_glob () - { - globfree (&m_glob); - } + ~gdb_glob () { globfree (&m_glob); } /* Return the GL_PATHC component of M_GLOB. */ - int pathc () const - { - return m_glob.gl_pathc; - } + int pathc () const { return m_glob.gl_pathc; } /* Return the GL_PATHV component of M_GLOB. */ - char **pathv () const - { - return m_glob.gl_pathv; - } + char **pathv () const { return m_glob.gl_pathv; } private: /* The actual glob object we're dealing with. */ @@ -89,11 +79,9 @@ gdb_tilde_expand (const char *dir) /* Look for the first dir separator (if any) and split d around it. */ const auto first_sep - = std::find_if (d.cbegin (), d.cend(), - [] (const char c) -> bool - { - return IS_DIR_SEPARATOR (c); - }); + = std::find_if (d.cbegin (), d.cend (), [] (const char c) -> bool { + return IS_DIR_SEPARATOR (c); + }); const std::string to_expand (d.cbegin (), first_sep); const std::string remainder (first_sep, d.cend ()); |