git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/2] Introduce the function strip_path_suffix()

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 19, 2009, 20:12 UTC
Message-ID
<alpine.DEB.1.00.0902192110290.6223@intel-tinevez-2-302>
In-Reply-To
<f6344cbba22e049806796f4920e229fb2e539d5c.1235070304u.git.johannes.schindelin@gmx.de>
Hi,
On Thu, 19 Feb 2009, Johannes Schindelin wrote:
Show 12 quoted lines
> The function strip_path_suffix() will try to strip a given suffix from 
> a given path.  The suffix must start at a directory boundary (i.e. "core" 
> is not a path suffix of "libexec/git-core", but "git-core" is).
> 
> Arbitrary runs of directory separators ("slashes") are assumed identical.
> 
> Example:
> 
> 	strip_path_suffix("C:\\msysgit/\\libexec\\git-core",
> 		"libexec///git-core", &prefix)
> 
> will set prefix to "C:\\msysgit" and return 0.
Aargh, of course I managed to forget to adjust the example.  Here it goes:
	prefix = strip_path_suffix("C:\\msysgit/\\libexec\\git-core",
			"libexec///git-core");
will set prefix to "C:\\msysgit".

Ciao, Dscho

Previous: Johannes SchindelinNext: Johannes Sixt
Message 9 of 20 in “RUNTIME_PREFIX enhancements”
  1. 0/2 RUNTIME_PREFIX enhancementsJohannes Schindelin, Feb 18, 2009
  2. 1/2 Introduce the function strip_path_suffix()Johannes Schindelin, Feb 18, 2009
  3. Johannes SixtFeb 18, 2009
  4. Johannes SchindelinFeb 18, 2009
  5. Johannes SixtFeb 18, 2009
  6. Johannes SchindelinFeb 18, 2009
  7. 0/2 RUNTIME_PREFIX enhancementsJohannes Schindelin, Feb 19, 2009
  8. 1/2 Introduce the function strip_path_suffix()Johannes Schindelin, Feb 19, 2009
  9. Johannes SchindelinFeb 19, 2009
  10. Johannes SixtFeb 19, 2009
  11. Johannes SchindelinFeb 19, 2009
  12. 2/2 system_path(): simplify using strip_path_suffix(), and add suffix "git"Johannes Schindelin, Feb 19, 2009
  13. Johannes SixtFeb 19, 2009
  14. Johannes SchindelinFeb 19, 2009
  15. Junio C HamanoFeb 20, 2009
  16. 2/2 system_path(): simplify using strip_path_suffix(), and add suffix "git"Johannes Schindelin, Feb 18, 2009
  17. Johannes SixtFeb 18, 2009
  18. Johannes SchindelinFeb 18, 2009
  19. Johannes SixtFeb 18, 2009
  20. Johannes SchindelinFeb 18, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.