git/builtin
Nguyễn Thái Ngọc Duy dcf692625a path.c: make get_pathname() call sites return const char *
Before the previous commit, get_pathname returns an array of PATH_MAX
length. Even if git_path() and similar functions does not use the
whole array, git_path() caller can, in theory.

After the commit, get_pathname() may return a buffer that has just
enough room for the returned string and git_path() caller should never
write beyond that.

Make git_path(), mkpath() and git_path_submodule() return a const
buffer to make sure callers do not write in it at all.

This could have been part of the previous commit, but the "const"
conversion is too much distraction from the core changes in path.c.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-12-01 11:00:10 -08:00
..
add.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
annotate.c annotate: use argv_array 2014-07-16 11:10:11 -07:00
apply.c Merge branch 'rs/more-uses-of-skip-prefix' 2014-10-14 10:50:07 -07:00
archive.c replace {pre,suf}fixcmp() with {starts,ends}_with() 2013-12-05 14:13:21 -08:00
bisect--helper.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
blame.c refs.c: change resolve_ref_unsafe reading argument to be a flags field 2014-10-15 10:47:24 -07:00
branch.c Merge branch 'rs/ref-transaction' 2014-10-21 13:28:10 -07:00
bundle.c
cat-file.c use skip_prefix() to avoid more magic numbers 2014-10-07 11:09:16 -07:00
check-attr.c Merge branch 'jc/check-attr-honor-working-tree' into maint 2014-03-18 14:03:03 -07:00
check-ignore.c Merge branch 'dw/check-ignore-sans-index' 2013-09-20 12:37:32 -07:00
check-mailmap.c builtin: add git-check-mailmap command 2013-07-13 10:19:37 -07:00
check-ref-format.c
checkout-index.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
checkout.c path.c: make get_pathname() call sites return const char * 2014-12-01 11:00:10 -08:00
clean.c Merge branch 'jn/parse-config-slot' 2014-10-20 12:23:48 -07:00
clone.c path.c: make get_pathname() call sites return const char * 2014-12-01 11:00:10 -08:00
column.c replace {pre,suf}fixcmp() with {starts,ends}_with() 2013-12-05 14:13:21 -08:00
commit-tree.c commit_tree: take a pointer/len pair rather than a const strbuf 2014-06-12 10:29:41 -07:00
commit.c Merge branch 'rs/ref-transaction' 2014-10-21 13:28:10 -07:00
config.c Merge branch 'jn/parse-config-slot' 2014-10-20 12:23:48 -07:00
count-objects.c count-objects: use for_each_loose_file_in_objdir 2014-10-16 10:10:41 -07:00
credential.c git credential fill: output the whole 'struct credential' 2012-06-25 11:56:24 -07:00
describe.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
diff-files.c convert read_cache_preload() to take struct pathspec 2013-07-15 10:56:08 -07:00
diff-index.c convert read_cache_preload() to take struct pathspec 2013-07-15 10:56:08 -07:00
diff-tree.c diff-tree: avoid lookup_unknown_object 2014-07-28 10:14:34 -07:00
diff.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
fast-export.c teach fast-export an --anonymize option 2014-08-27 10:42:16 -07:00
fetch-pack.c Merge branch 'nd/shallow-clone' 2014-01-17 12:21:20 -08:00
fetch.c path.c: make get_pathname() call sites return const char * 2014-12-01 11:00:10 -08:00
fmt-merge-msg.c refs.c: change resolve_ref_unsafe reading argument to be a flags field 2014-10-15 10:47:24 -07:00
for-each-ref.c Merge branch 'rs/ref-transaction' 2014-10-21 13:28:10 -07:00
fsck.c path.c: make get_pathname() call sites return const char * 2014-12-01 11:00:10 -08:00
gc.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
get-tar-commit-id.c use skip_prefix() to avoid more magic numbers 2014-10-07 11:09:16 -07:00
grep.c make add_object_array_with_context interface more sane 2014-10-16 10:10:44 -07:00
hash-object.c hash-object: add --literally option 2014-09-11 14:23:51 -07:00
help.c doc: add 'everyday' to 'git help' 2014-10-10 16:02:26 -07:00
index-pack.c index-pack: fix compilation with NO_PTHREADS 2014-10-13 12:33:30 -07:00
init-db.c Merge branch 'rs/strbuf-getcwd' 2014-09-02 13:28:44 -07:00
interpret-trailers.c trailer: add interpret-trailers command 2014-10-13 13:55:27 -07:00
log.c Merge branch 'rs/ref-transaction' 2014-10-21 13:28:10 -07:00
ls-files.c grammofix in user-facing messages 2014-09-02 12:00:30 -07:00
ls-remote.c builtin/ls-remote.c: rearrange xcalloc arguments 2014-05-27 14:00:43 -07:00
ls-tree.c pathspec: rename match_pathspec_depth() to match_pathspec() 2014-02-24 14:37:14 -08:00
mailinfo.c mailinfo: work around -Wstring-plus-int warning 2014-09-22 13:46:43 -07:00
mailsplit.c mailsplit: remove unnecessary unlink(2) call 2014-10-07 10:49:57 -07:00
merge-base.c Merge branch 'bm/merge-base-octopus-dedup' into maint 2014-02-13 13:38:59 -08:00
merge-file.c Replace deprecated OPT_BOOLEAN by OPT_BOOL 2013-08-05 11:32:19 -07:00
merge-index.c Convert "struct cache_entry *" to "const ..." wherever possible 2013-07-09 09:12:48 -07:00
merge-ours.c
merge-recursive.c replace {pre,suf}fixcmp() with {starts,ends}_with() 2013-12-05 14:13:21 -08:00
merge-tree.c merge-tree: remove unused df_conflict arguments 2014-09-02 11:02:58 -07:00
merge.c refs.c: change resolve_ref_unsafe reading argument to be a flags field 2014-10-15 10:47:24 -07:00
mktag.c
mktree.c builtin/mktree.c: use ALLOC_GROW() in append_to_tree() 2014-03-03 14:54:45 -08:00
mv.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
name-rev.c use xstrfmt to replace xmalloc + strcpy/strcat 2014-06-19 15:20:54 -07:00
notes.c refs.c: change resolve_ref_unsafe reading argument to be a flags field 2014-10-15 10:47:24 -07:00
pack-objects.c Merge branch 'jk/prune-mtime' 2014-10-29 10:07:56 -07:00
pack-redundant.c Fix sizeof usage in get_permutations 2012-12-13 11:13:44 -08:00
pack-refs.c pack-refs: merge code from pack-refs.{c,h} into refs.{c,h} 2013-05-01 15:33:11 -07:00
patch-id.c patch-id: make it stable against hunk reordering 2014-06-10 13:09:24 -07:00
prune-packed.c prune-packed: use for_each_loose_file_in_objdir 2014-10-16 10:10:40 -07:00
prune.c prune: keep objects reachable from recent objects 2014-10-16 10:10:42 -07:00
push.c push: heed user.signingkey for signed pushes 2014-10-24 10:50:05 -07:00
read-tree.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
receive-pack.c path.c: make get_pathname() call sites return const char * 2014-12-01 11:00:10 -08:00
reflog.c Merge branch 'jk/prune-mtime' 2014-10-29 10:07:56 -07:00
remote-ext.c use skip_prefix() to avoid more magic numbers 2014-10-07 11:09:16 -07:00
remote-fd.c
remote.c path.c: make get_pathname() call sites return const char * 2014-12-01 11:00:10 -08:00
repack.c path.c: make get_pathname() call sites return const char * 2014-12-01 11:00:10 -08:00
replace.c refs.c: pass the ref log message to _create/delete/update instead of _commit 2014-10-15 10:47:22 -07:00
rerere.c rerere: fix for merge.conflictstyle 2014-04-30 10:30:02 -07:00
reset.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
rev-list.c commit: record buffer length in cache 2014-06-13 12:09:38 -07:00
rev-parse.c refs: make rev-parse --quiet actually quiet 2014-09-19 10:46:15 -07:00
revert.c parse-options: multi-word argh should use dash to separate words 2014-03-24 10:43:34 -07:00
rm.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
send-pack.c Merge branch 'jc/push-cert' 2014-10-08 13:05:25 -07:00
shortlog.c replace {pre,suf}fixcmp() with {starts,ends}_with() 2013-12-05 14:13:21 -08:00
show-branch.c refs.c: change resolve_ref_unsafe reading argument to be a flags field 2014-10-15 10:47:24 -07:00
show-ref.c replace {pre,suf}fixcmp() with {starts,ends}_with() 2013-12-05 14:13:21 -08:00
stripspace.c builtin/stripspace.c: fix broken indentation 2013-09-06 13:33:17 -07:00
symbolic-ref.c refs.c: change resolve_ref_unsafe reading argument to be a flags field 2014-10-15 10:47:24 -07:00
tag.c refs.c: pass the ref log message to _create/delete/update instead of _commit 2014-10-15 10:47:22 -07:00
unpack-file.c
unpack-objects.c fsck_object(): allow passing object data separately from the object itself 2014-09-10 13:54:21 -07:00
update-index.c lockfile.h: extract new header file for the functions in lockfile.c 2014-10-01 13:56:14 -07:00
update-ref.c refs.c: pass the ref log message to _create/delete/update instead of _commit 2014-10-15 10:47:22 -07:00
update-server-info.c i18n: update-server-info: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00
upload-archive.c replace {pre,suf}fixcmp() with {starts,ends}_with() 2013-12-05 14:13:21 -08:00
var.c
verify-commit.c verify-commit: scriptable commit signature verification 2014-06-23 15:50:31 -07:00
verify-pack.c run-command: introduce CHILD_PROCESS_INIT 2014-08-20 09:53:37 -07:00
verify-tag.c gpg_interface: allow to request status return 2013-02-14 09:30:04 -08:00
write-tree.c i18n: write-tree: mark parseopt strings for translation 2012-08-22 10:58:29 -07:00