aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
Diffstat (limited to 'erts')
-rw-r--r--erts/doc/src/inet_cfg.xml13
-rw-r--r--erts/etc/common/escript.c36
2 files changed, 29 insertions, 20 deletions
diff --git a/erts/doc/src/inet_cfg.xml b/erts/doc/src/inet_cfg.xml
index 18cf65759a..2a033c037c 100644
--- a/erts/doc/src/inet_cfg.xml
+++ b/erts/doc/src/inet_cfg.xml
@@ -4,7 +4,7 @@
<chapter>
<header>
<copyright>
- <year>2004</year><year>2009</year>
+ <year>2004</year><year>2010</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -13,12 +13,12 @@
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
-
+
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
-
+
</legalnotice>
<title>Inet configuration</title>
@@ -230,6 +230,13 @@
(use the Erlang DNS client
<seealso marker="kernel:inet_res">inet_res</seealso>
for nameserver queries).</p>
+ <p>The lookup method <c><![CDATA[string]]></c> tries to
+ parse the hostname as a IPv4 or IPv6 string and return
+ the resulting IP address. It is automatically tried
+ first when <c><![CDATA[native]]></c> is <em>not</em>
+ in the <c><![CDATA[Methods]]></c> list. To skip it in this case
+ the pseudo lookup method <c><![CDATA[nostring]]></c> can be
+ inserted anywhere in the <c><![CDATA[Methods]]></c> list.</p>
<p></p>
</item>
<tag><em><c><![CDATA[{cache_size, Size}.]]></c></em></tag>
diff --git a/erts/etc/common/escript.c b/erts/etc/common/escript.c
index ab37d4af46..1bc5eb7651 100644
--- a/erts/etc/common/escript.c
+++ b/erts/etc/common/escript.c
@@ -1,19 +1,19 @@
/*
* %CopyrightBegin%
- *
- * Copyright Ericsson AB 2007-2009. All Rights Reserved.
- *
+ *
+ * Copyright Ericsson AB 2007-2010. All Rights Reserved.
+ *
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
* compliance with the License. You should have received a copy of the
* Erlang Public License along with this software. If not, it can be
* retrieved online at http://www.erlang.org/.
- *
+ *
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
- *
+ *
* %CopyrightEnd%
*/
/*
@@ -199,9 +199,10 @@ find_prog(char *origpath)
continue;
} else {
/* Wow we found the executable. */
- strcpy(abspath, wildcard);
+ strcpy(relpath, wildcard);
FindClose(dir_handle);
- return strsave(abspath);
+ look_for_sep = FALSE;
+ break;
}
#else
dp = opendir(dir);
@@ -216,11 +217,12 @@ find_prog(char *origpath)
if (strcmp(origpath, dirp->d_name) == 0) {
/* Wow we found the executable. */
- strcpy(abspath, dir);
- strcat(abspath, DIRSEPSTR);
- strcat(abspath, dirp->d_name);
+ strcpy(relpath, dir);
+ strcat(relpath, DIRSEPSTR);
+ strcat(relpath, dirp->d_name);
closedir(dp);
- return strsave(abspath);
+ look_for_sep = FALSE;
+ break;
}
}
}
@@ -239,8 +241,8 @@ find_prog(char *origpath)
#else
if (!realpath(relpath, abspath)) {
#endif /* __WIN32__ */
- /* Cannot determine absolute path to escript. Try the relative. */
- return strsave(relpath);
+ /* Cannot determine absolute path to escript. Try the origin. */
+ return strsave(origpath);
} else {
return strsave(abspath);
}
@@ -373,11 +375,10 @@ main(int argc, char** argv)
if (strcmp(basename, "escript") == 0) {
#endif
/*
- * Push all options (without the hyphen) before the script name.
+ * Locate all options before the script name.
*/
while (argc > 1 && argv[1][0] == '-') {
- PUSH(argv[1]+1);
argc--;
argv++;
last_opt = argv;
@@ -402,6 +403,7 @@ main(int argc, char** argv)
scriptname[len-4] = '\0';
}
#endif
+
strcat(scriptname, ".escript");
}
@@ -418,7 +420,7 @@ main(int argc, char** argv)
PUSH3("-run", "escript", "start");
/*
- * Push all options (without the hyphen) before the script name.
+ * Push all options before the script name. But omit the leading hyphens.
*/
while (first_opt != last_opt) {
@@ -500,7 +502,7 @@ char *make_commandline(char **argv)
*(--p) = '\0';
if (debug) {
- printf("Processed commandline:%s\n",buff);
+ printf("Processed command line:%s\n",buff);
}
return buff;
}