summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRene Engelhard <rene@openoffice.org>2010-05-18 14:05:20 +0200
committerRene Engelhard <rene@openoffice.org>2010-05-18 14:05:20 +0200
commit7eba4ceaf574246d971ae01a8f52c5f075aca35a (patch)
tree12badf5b8c6f32eb82987574833a22db45986c23 /tools
parentc5934ada09feec288519cbdfbe1c0c988a2fceec (diff)
systemlibc: migrate systemlibc to hg; try again from scratch
Diffstat (limited to 'tools')
-rw-r--r--tools/bootstrp/rscdep.cxx49
1 files changed, 1 insertions, 48 deletions
diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx
index 5c18793c9833..ebe1e2f412e2 100644
--- a/tools/bootstrp/rscdep.cxx
+++ b/tools/bootstrp/rscdep.cxx
@@ -70,15 +70,6 @@ void RscHrcDep::Execute()
//static String aDelim;
-/* poor man's getopt() */
-int simple_getopt(char *argv[], const char *optstring);
-#if defined(WNT) || defined(OS2)
-static char *optarg = NULL;
-static int optind = 1;
-static int optopt = 0;
-static int opterr = 0;
-#endif
-
SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
{
int c;
@@ -179,7 +170,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
while( 1 )
{
- c = simple_getopt( argv,
+ c = getopt( argc, argv,
"_abcdefghi:jklmnopqrstuvwxyzABCDEFGHI:JKLMNOPQRSTUVWXYZ1234567890/-+=.\\()\"");
if ( c == -1 )
break;
@@ -296,41 +287,3 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv )
return 0;
}
-/* my very simple minded implementation of getopt()
- * it's too sad that getopt() is not available everywhere
- * note: this is not a full POSIX conforming getopt()
- */
-int simple_getopt(char *argv[], const char *optstring)
-{
- char *arg = argv[optind];
-
- /* skip all response file arguments */
- if ( arg ) {
- while ( *arg == '@' )
- arg = argv[++optind];
-
- if ( arg[0] == '-' && arg[1] != '\0' ) {
- const char *popt;
- int c = arg[1];
- if ( (popt = strchr(optstring, c)) == NULL ) {
- optopt = c;
- if ( opterr )
- fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
- return '?';
- }
- if ( *(++popt) == ':') {
- if ( arg[2] != '\0' ) {
- optarg = ++arg;
- } else {
- optarg = argv[++optind];
- }
- } else {
- optarg = NULL;
- }
- ++optind;
- return c;
- }
- }
- return -1;
-}
-