plan9fox/sys/lib
Ori Bernstein cfebf83947 git: better handling of absolute paths, regex metachars
Git currently gets a bit confused if you try to
manipulate files by absolute path.  There were also a
number of places where user-controlled file paths ended
up getting passed to regex interpretation, which could
confuse things.

This change mainly does 2 things:

	- Adds a 'drop' function which drops
	  a non-regex prefix from a string, and uses
	  that to manipulate paths, simplifies 'subst',
	  and removes 'subst -g', which was only used
	  with fixed regexes; sed does this job fine.
	- When getting a path from a user, we
	  make it absolute and then strip out the head

Along the way it cleans up a couple of stupids:

	- 'for(f in $list) if(! ~ $#f 0) use $f:
	  $f can't be a nil list because of
	  list flattening.
	- removes a useless substitution here:

	 	all=`$nl{{git/query -c $1 $2; git/query -c $2 $3} | sed 's/^..//' | \
			gsubst '^('$ourbr'|'$basebr'|'$theirbr')/*' | sort | uniq}

	  where git/query -c doesn't produce
	  paths prefixed with the query.
2021-08-17 04:31:15 +00:00
..
acid acid/kernel: for stacktraces, try to use context from error stack when process is not sleeping 2019-09-12 15:28:04 +02:00
antiword
astar
backup backup: Set execution bits in backup scripts 2019-10-13 10:20:10 +02:00
blit move blit roms to /sys/lib/blit 2017-03-29 01:33:16 +02:00
c64 added games/c64 2015-02-07 18:03:17 +01:00
dist /sys/lib/dist/mkfile: test for .git directory 2021-06-13 13:21:12 +00:00
fax
ghostscript gs: apply fixes for CVE-2018-16509 (thanks jsmoody) 2019-05-23 14:59:28 +02:00
git git: better handling of absolute paths, regex metachars 2021-08-17 04:31:15 +00:00
kbmap /sys/lib/kbmap/colemak: map capslock to backspace (thanks jacob wb) 2021-05-20 21:29:43 +02:00
lex
lp lp: HTML table support 2012-09-10 08:10:30 +02:00
man fix wrong manpage section index generation for rc-httpd(8) 2016-08-27 22:37:08 +02:00
music/icon
plumb plumb/basic: handle tga, wav, au, mid and mus 2021-01-12 10:13:00 +01:00
postscript troff: fix mangled fonts and character files 2021-06-15 16:13:59 +00:00
scribble/classifiers
sysconfig distproto: remove .hgnore and .hg and add .git directory 2021-06-06 18:09:33 +00:00
texmf/tex/generic/hyphen
tls
tmac tmac.eai: wrapper around -me: auto indexing sections, .TC macro (thanks sirjofri) 2020-05-04 11:57:24 +02:00
troff troff: fix mangled fonts and character files 2021-06-15 16:13:59 +00:00
wiki
amspell
bclib
brspell
eqnchar
grap.defines
hgrc hg: create system wide /sys/lib/hgrc to enabled hgwebfs extension 2016-04-10 20:39:10 +02:00
httpd.rewrite
mimetype [9front] mimetype: add entry for .patch extension 2021-02-08 21:09:17 -08:00
newuser newuser: /n/other now handled in /lib/namespace 2016-02-14 01:52:51 +01:00
rootbind
rootstub rootstub: add /sys/lib/dist/ndb/dhcp/ 2019-05-03 23:59:27 +02:00
samsave sam: mark samsave executable 2014-06-25 03:13:52 -07:00
scsicodes
subscribers
webls.denied
yaccpar
yaccpars