Revise the code for loading configuration files#1519
Revise the code for loading configuration files#1519masatake merged 27 commits intouniversal-ctags:masterfrom
Conversation
main/options.c
Outdated
| {"debug", "TO BE WRITTEN"}, | ||
| #endif | ||
| #ifdef HAVE_SCANDIR | ||
| #if defined(HAVE_SCANDIR) || defined (HAVE_DIRENT_H) || defined (_MSVC) |
main/portable-scandir.c
Outdated
| if (counter + 1 == allocated) { | ||
| allocated <<= 1; | ||
| array = (struct dirent **) | ||
| realloc_safe((char *)array, allocated * sizeof(struct dirent *)); |
There was a problem hiding this comment.
https://ci.appveyor.com/project/universalctags/ctags/build/1.0.183/job/1p916w3u7sc4hjoh#L261
Build failed because of realloc_safe.
dc52e6f to
a15c692
Compare
eb720c3 to
c9fa895
Compare
|
O.k. we can use scandir any platform where ctags runs. I will remove ~/.ctags file support from u-ctags. Instead I will introduce ~/.u-ctags DIRECTORY. |
|
msbuild fails with unknown error. msvc x64 build fails with the option-extras-enabling-all test. |
c9fa895 to
a79f557
Compare
main/portable-dirent.h
Outdated
| #endif | ||
|
|
||
| #else | ||
| #erorr "No dirent.h" |
There was a problem hiding this comment.
Still failing because of these two lines. You can remove them now.
If you think they are still needed, then you should move them between L388 and L389.
s/#erorr/#error/
There was a problem hiding this comment.
The last change is not enough. I meant:
--- a/main/portable-dirent.h
+++ b/main/portable-dirent.h
@@ -382,8 +382,8 @@ static void rewinddir(DIR* dirp)
}
#endif
-#else
-#error "dirent.h is not available."
#endif /*DIRENT_H*/
+#else
+#error "dirent.h is not available."
#endif /* HAVE_DIRENT_H */
|
@k-takata, I have a question about filename on Windows. https://ja.wikipedia.org/wiki/8.3%E5%BD%A2%E5%BC%8F (Japanese) This limitation(?) about file name is still applicable (or existing) in Windows these days? I would like to use '.ctags' as an extension for ctags option library on all platforms where u-ctags runs. However, man page of exuberant-ctags says .cnf is used as an extension. I think we can forget MSDOS. Do you agree this? |
|
I don't think we should still care about the 8.3 filenames. |
|
Another new errors: https://ci.appveyor.com/project/universalctags/ctags/build/1.0.191/job/mgh91tgiii06simc#L72 |
Thank you. I hope I can find time to think about the new file names in this weekend. |
main/portable-scandir.c
Outdated
| @@ -0,0 +1,243 @@ | |||
| #include "general.h" | |||
| /* | |||
| * Taken from https://raw.githubusercontent.com/ClusterLabs/pacemaker/master/replace/scandir.c | |||
There was a problem hiding this comment.
Isn't it better to use non-raw URL, so that one can easily get the information (history, etc.) of the file?
https://github.com/ClusterLabs/pacemaker/blob/master/replace/scandir.c
main/portable-scandir.c
Outdated
| * The original author put this code in the public domain. | ||
| * It has been modified slightly to get rid of warnings, etc. | ||
| * | ||
| * Below is the email I received from pinard@iro.umontreal.ca (Fran�ois Pinard) |
There was a problem hiding this comment.
Encoding seems broken.
s/Fran�ois/François/
The original file was latin 1 (ISO 8859-1), but maybe it's batter to use UTF-8?
main/portable-scandir.c
Outdated
| * | ||
| * Subject: Re: Scandir replacement function | ||
| * Date: 18 May 2001 12:00:48 -0400 | ||
| * From: pinard@iro.umontreal.ca (Fran�ois Pinard) |
ce12dba to
44c718c
Compare
|
@k-takata, reflected the your comment to the changes and updated. I update portable-getdents.h. So we will get build-errors again. |
|
Now |
|
Something wrong in circleci. However, we can ignore it. @k-takata, thank you for great advices. Especially the last comment is really helpful. I will squash some of commits. |
281a57a to
1f89dbb
Compare
…d .d when loading optlib files TODO Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Spotted by @k-takata. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Does the same as ``--options`` but doesn't make an error if *file* (or *directory*) doesn't exist. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
…and --options Suggested by @codebrainz and @k-takata.
Suggested by @k-takata. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
61ba2cf to
6c25428
Compare
|
Squashed some "fixup!" commits. |
Refer to universal-ctags/ctags#1519. [ci skip]
option-directory feature was not available on platforms
where scandir is not available.