c***@lists.sourceforge.net
2010-04-13 12:04:41 UTC
Send clisp-cvs mailing list submissions to
clisp-***@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/clisp-cvs
or, via email, send a message with subject or body 'help' to
clisp-cvs-***@lists.sourceforge.net
You can reach the person managing the list at
clisp-cvs-***@lists.sourceforge.net
When replying, please edit your Subject line so it is more specific
than "Re: Contents of clisp-cvs digest..."
CLISP CVS commits for today
Today's Topics:
1. clisp/src ChangeLog,1.7301,1.7302 spvw.d,1.524,1.525
(Sam Steingold)
2. clisp/src ChangeLog, 1.7302, 1.7303 spvw.d, 1.525, 1.526
spvw_sigterm.d, 1.13, 1.14 (Sam Steingold)
3. clisp/src ChangeLog, 1.7303, 1.7304 spvw.d, 1.526, 1.527
spvw_sigterm.d, 1.14, 1.15 (Vladimir Tzankov)
4. clisp/src spvw.d,1.527,1.528 (Sam Steingold)
5. clisp/src ChangeLog,1.7304,1.7305 w32shell.c,1.11,1.12
(Arseny Slobodyuk)
----------------------------------------------------------------------
Message: 1
Date: Mon, 12 Apr 2010 18:29:34 +0000
From: Sam Steingold <***@users.sourceforge.net>
Subject: clisp/src ChangeLog,1.7301,1.7302 spvw.d,1.524,1.525
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1OO6-0002YM-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9794/src
Modified Files:
ChangeLog spvw.d
Log Message:
(quit_on_signal_in_progress) [MULTITHREAD]: add
(signal_handler_thread) [MULTITHREAD]: fix last patch:
set quit_on_signal_in_progress when terminating
Index: spvw.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw.d,v
retrieving revision 1.524
retrieving revision 1.525
diff -u -d -r1.524 -r1.525
--- spvw.d 4 Mar 2010 21:15:29 -0000 1.524
+++ spvw.d 12 Apr 2010 18:29:32 -0000 1.525
@@ -2491,7 +2491,7 @@
if (asciz_equal(arg,"-help-image")) {
p2->argv_help_image = true;
break;
- } else if (arg[2] != 0)
+ } else if (arg[2] != 0)
INVALID_ARG(arg);
else {
usage(delegating);
@@ -2526,7 +2526,7 @@
case 't': /* traditional, temporary directory */
if (asciz_equal(arg,"-traditional"))
p2->argv_ansi = 2; /* traditional */
- else
+ else
INVALID_ARG(arg);
break;
case 'd': /* -d (developer mode) or -disable-readline */
@@ -2534,7 +2534,7 @@
disable_readline = true;
else if (arg[2] == '\0')
p2->argv_developer = true;
- else
+ else
INVALID_ARG(arg);
break;
case 'B': /* lisplibdir */
@@ -2548,7 +2548,7 @@
case 'n':
if (asciz_equal(arg,"-norc"))
p2->argv_norc = true;
- else
+ else
INVALID_ARG(arg);
break;
#if defined(UNIX) || defined(WIN32_NATIVE)
@@ -2590,39 +2590,39 @@
argv_encoding_file = argv_encoding_pathname =
argv_encoding_terminal = argv_encoding_foreign =
argv_encoding_misc = *argptr++;
- else
+ else
INVALID_ARG(arg);
break;
case 'q': /* verbosity level */
p2->argv_verbose--;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case 'v': /* verbosity level */
p2->argv_verbose++;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case 'I': /* ILISP-friendly */
ilisp_mode = true;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case 'C': /* set *LOAD-COMPILING* */
p2->argv_load_compiling = true;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case 'r': /* -repl */
if (asciz_equal(&arg[1],"repl"))
p2->argv_repl = true;
- else
+ else
INVALID_ARG(arg);
break;
case 'i': /* initialization files */
if (arg[2] == '\0')
argv_for = for_init;
- else
+ else
INVALID_ARG(arg);
break;
case 'c': /* files to be compiled */
@@ -2630,10 +2630,10 @@
argv_for = for_compile;
if (arg[2] == 'l') {
p2->argv_compile_listing = true;
- if (arg[3] != '\0')
+ if (arg[3] != '\0')
INVALID_ARG(arg);
} else {
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
}
break;
@@ -2642,14 +2642,14 @@
p2->argv_compile_listing = true;
else if (arg[2] == 'p' && arg[3] == 0) {
argv_for = for_load_path;
- } else
+ } else
INVALID_ARG(arg);
break;
case 'o':
if (asciz_equal(&arg[1],"on-error")) {
if (argptr < argptr_limit)
arg = *argptr++;
- else
+ else
INVALID_ARG(arg);
if (asciz_equal(arg,"default"))
p2->argv_on_error = ON_ERROR_DEFAULT;
@@ -2668,10 +2668,10 @@
} else if (arg[2] == '\0') { /* target for files to be compiled */
OPTION_ARG;
if (!((p2->argv_compile_filecount > 0)
- && (p2->argv_compile_files[p2->argv_compile_filecount-1].output_file==NULL)))
+ && (p2->argv_compile_files[p2->argv_compile_filecount-1].output_file==NULL)))
INVALID_ARG(arg);
p2->argv_compile_files[p2->argv_compile_filecount-1].output_file = arg;
- } else
+ } else
INVALID_ARG(arg);
break;
case 'p': /* package: when repeated, only the last one counts. */
@@ -2681,17 +2681,17 @@
case 'a': /* ANSI CL Compliance */
if (asciz_equal(arg,"-ansi"))
p2->argv_ansi = 1; /* ANSI */
- else
+ else
INVALID_ARG(arg);
break;
case 'x': /* execute LISP-expression */
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
argv_for = for_expr;
break;
case 'w': /* wait for keypress after termination */
p2->argv_wait_keypress = true;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case '-': /* -- GNU-style long options */
@@ -4547,6 +4547,7 @@
/* UP: The signal handler in MT build.
local void *signal_handler_thread(void *arg)
{
while (1) {
@@ -4659,6 +4660,7 @@
break;
#endif
default:
+ quit_on_signal_in_progress = true;
/* just terminate all threads - the last one will
kill the process from delete_thread */
WITH_STOPPED_WORLD(false,{
Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7301
retrieving revision 1.7302
diff -u -d -r1.7301 -r1.7302
--- ChangeLog 11 Apr 2010 20:29:47 -0000 1.7301
+++ ChangeLog 12 Apr 2010 18:29:32 -0000 1.7302
@@ -1,3 +1,9 @@
+2010-04-12 Sam Steingold <***@gnu.org>
+
+ * spvw.d (quit_on_signal_in_progress) [MULTITHREAD]: add
+ (signal_handler_thread) [MULTITHREAD]: fix last patch:
+ set quit_on_signal_in_progress when terminating
+
2010-04-11 Sam Steingold <***@gnu.org>
fix bug#2795278: when quitting on signals, do not enter the debugger
------------------------------
Message: 2
Date: Mon, 12 Apr 2010 18:45:22 +0000
From: Sam Steingold <***@users.sourceforge.net>
Subject: clisp/src ChangeLog, 1.7302, 1.7303 spvw.d, 1.525, 1.526
spvw_sigterm.d, 1.13, 1.14
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1OdP-000459-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15680/src
Modified Files:
ChangeLog spvw.d spvw_sigterm.d
Log Message:
define quit_on_signal_in_progress just once, in spvw_sigterm,
independent of MULTITHREAD
Index: spvw_sigterm.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw_sigterm.d,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- spvw_sigterm.d 11 Apr 2010 20:29:48 -0000 1.13
+++ spvw_sigterm.d 12 Apr 2010 18:45:20 -0000 1.14
@@ -1,4 +1,8 @@
/* Handling of terminating signals. */
+
+/* MULTITHREAD: set in spvw.d:signal_handler_thread() */
+global bool quit_on_signal_in_progress = false;
+
#if !defined(MULTITHREAD)
/* --------------------------- Specification ----------------------------- */
@@ -42,7 +46,6 @@
}
-global bool quit_on_signal_in_progress = false;
/* print the "exiting" message and quit */
local void quit_on_signal (int sig) {
#ifndef NO_ASYNC_INTERRUPTS
Index: spvw.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw.d,v
retrieving revision 1.525
retrieving revision 1.526
diff -u -d -r1.525 -r1.526
--- spvw.d 12 Apr 2010 18:29:32 -0000 1.525
+++ spvw.d 12 Apr 2010 18:45:20 -0000 1.526
@@ -4547,7 +4547,6 @@
/* UP: The signal handler in MT build.
local void *signal_handler_thread(void *arg)
{
while (1) {
Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7302
retrieving revision 1.7303
diff -u -d -r1.7302 -r1.7303
--- ChangeLog 12 Apr 2010 18:29:32 -0000 1.7302
+++ ChangeLog 12 Apr 2010 18:45:20 -0000 1.7303
@@ -1,7 +1,7 @@
2010-04-12 Sam Steingold <***@gnu.org>
- * spvw.d (quit_on_signal_in_progress) [MULTITHREAD]: add
- (signal_handler_thread) [MULTITHREAD]: fix last patch:
+ * spvw_sigterm.d (quit_on_signal_in_progress): always define
+ * spvw.d (signal_handler_thread) [MULTITHREAD]: fix last patch:
set quit_on_signal_in_progress when terminating
2010-04-11 Sam Steingold <***@gnu.org>
------------------------------
Message: 3
Date: Mon, 12 Apr 2010 19:37:40 +0000
From: Vladimir Tzankov <***@users.sourceforge.net>
Subject: clisp/src ChangeLog, 1.7303, 1.7304 spvw.d, 1.526, 1.527
spvw_sigterm.d, 1.14, 1.15
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1PS0-0000LT-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv843/src
Modified Files:
ChangeLog spvw.d spvw_sigterm.d
Log Message:
[MULTITHREAD]: fix process exit code on terminating signals
Index: spvw_sigterm.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw_sigterm.d,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- spvw_sigterm.d 12 Apr 2010 18:45:20 -0000 1.14
+++ spvw_sigterm.d 12 Apr 2010 19:37:38 -0000 1.15
@@ -1,8 +1,6 @@
/* Handling of terminating signals. */
-/* MULTITHREAD: set in spvw.d:signal_handler_thread() */
-global bool quit_on_signal_in_progress = false;
-
+/* in MT signals are handled in spvw.d:signal_handler_thread()*/
#if !defined(MULTITHREAD)
/* --------------------------- Specification ----------------------------- */
Index: spvw.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw.d,v
retrieving revision 1.526
retrieving revision 1.527
diff -u -d -r1.526 -r1.527
--- spvw.d 12 Apr 2010 18:45:20 -0000 1.526
+++ spvw.d 12 Apr 2010 19:37:37 -0000 1.527
@@ -3904,6 +3904,7 @@
quit();
+global bool quit_on_signal_in_progress = false;
local int quit_retry = 0;
nonreturning_function(global, quit, (void)) {
/* first "unwind" the STACK downto STACK-end: */
@@ -4280,27 +4281,35 @@
sigaddset(&sigblock_mask,SIGINT);
sigaddset(&sigblock_mask,SIGALRM);
sigaddset(&sigblock_mask,SIG_TIMEOUT_CALL);
+ #if defined(SIGWINCH)
+ sigaddset(&sigblock_mask,SIGWINCH);
+ #endif
+ /* following are terminating signals - handle them only if we are not
+ already being killed*/
+ if (!quit_on_signal_in_progress) {
#ifdef SIGHUP
- sigaddset(&sigblock_mask,SIGHUP);
+ sigaddset(&sigblock_mask,SIGHUP);
#endif
#ifdef SIGQUIT
- sigaddset(&sigblock_mask,SIGQUIT);
+ sigaddset(&sigblock_mask,SIGQUIT);
#endif
#ifdef SIGILL
- sigaddset(&sigblock_mask,SIGILL);
+ sigaddset(&sigblock_mask,SIGILL);
#endif
#ifdef SIGABRT
- sigaddset(&sigblock_mask,SIGABRT);
+ sigaddset(&sigblock_mask,SIGABRT);
#endif
#ifdef SIGKILL
- sigaddset(&sigblock_mask,SIGKILL);
+ sigaddset(&sigblock_mask,SIGKILL);
#endif
#ifdef SIGTERM
- sigaddset(&sigblock_mask,SIGTERM);
+ sigaddset(&sigblock_mask,SIGTERM);
#endif
- #if defined(SIGWINCH)
- sigaddset(&sigblock_mask,SIGWINCH);
+ #ifdef SIGTTOU
+ /* always ignored */
+ sigaddset(&sigblock_mask,SIGTTOU);
#endif
+ }
return sigblock_mask;
}
@@ -4659,12 +4668,14 @@
break;
#endif
default:
- quit_on_signal_in_progress = true;
/* just terminate all threads - the last one will
kill the process from delete_thread */
+ fprintf(stderr, "Exiting on signal %d\n", sig);
WITH_STOPPED_WORLD(false,{
- var bool some_failed=true;
+ var bool all_succeeded = true;
ENABLE_DUMMY_ALLOCCOUNT(true);
+ quit_on_signal_in_progress = true;
+ final_exitcode = -sig; /* set process exit code */
for_all_threads({
/* be sure the signal handler can be reentered */
spinlock_acquire(&thread->_signal_reenter_ok);
@@ -4672,12 +4683,12 @@
NC_pushSTACK(thread->_STACK,S(thread_throw_tag)); /* %THROW-TAG */
NC_pushSTACK(thread->_STACK,posfixnum(1)); /* 1 argument */
NC_pushSTACK(thread->_STACK,T); /* do not defer the interrupt */
- some_failed &= interrupt_thread(thread);
+ all_succeeded &= interrupt_thread(thread);
});
- if (some_failed) {
+ if (!all_succeeded) {
fputs("*** some threads were not signaled to terminate.",stderr);
- exit(sig); /* nothing we can do - exit immediately (cannot call quit
- from here) */
+ exit(-sig); /* nothing we can do - exit immediately (cannot call quit
+ from here) */
}
ENABLE_DUMMY_ALLOCCOUNT(false);
});
Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7303
retrieving revision 1.7304
diff -u -d -r1.7303 -r1.7304
--- ChangeLog 12 Apr 2010 18:45:20 -0000 1.7303
+++ ChangeLog 12 Apr 2010 19:37:37 -0000 1.7304
@@ -1,3 +1,13 @@
+2010-04-12 Vladimir Tzankov <***@gmail.com>
+
+ * spvw_sigterm.d (quit_on_signal_in_progress): move to spvw.d
+ * spvw.d (quit_on_signal_in_progress): define it here
+ (async_signal_mask) [POSIX_THREADS]: do not add terminating signals if
+ process was already signaled with one of them
+ (signal_handler_thread): set proper exit code on terminating signal.
+ print to stderr "Exiting on signal ...". fix erroneous message on
+ terminating signal
+
2010-04-12 Sam Steingold <***@gnu.org>
* spvw_sigterm.d (quit_on_signal_in_progress): always define
------------------------------
Message: 4
Date: Mon, 12 Apr 2010 20:23:24 +0000
From: Sam Steingold <***@users.sourceforge.net>
Subject: clisp/src spvw.d,1.527,1.528
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1QAG-0004IY-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16513
Modified Files:
spvw.d
Log Message:
indentation
Index: spvw.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw.d,v
retrieving revision 1.527
retrieving revision 1.528
diff -u -d -r1.527 -r1.528
--- spvw.d 12 Apr 2010 19:37:37 -0000 1.527
+++ spvw.d 12 Apr 2010 20:23:22 -0000 1.528
@@ -4281,34 +4281,34 @@
sigaddset(&sigblock_mask,SIGINT);
sigaddset(&sigblock_mask,SIGALRM);
sigaddset(&sigblock_mask,SIG_TIMEOUT_CALL);
- #if defined(SIGWINCH)
- sigaddset(&sigblock_mask,SIGWINCH);
- #endif
+ #if defined(SIGWINCH)
+ sigaddset(&sigblock_mask,SIGWINCH);
+ #endif
/* following are terminating signals - handle them only if we are not
already being killed*/
if (!quit_on_signal_in_progress) {
- #ifdef SIGHUP
+ #ifdef SIGHUP
sigaddset(&sigblock_mask,SIGHUP);
- #endif
- #ifdef SIGQUIT
+ #endif
+ #ifdef SIGQUIT
sigaddset(&sigblock_mask,SIGQUIT);
- #endif
- #ifdef SIGILL
+ #endif
+ #ifdef SIGILL
sigaddset(&sigblock_mask,SIGILL);
- #endif
- #ifdef SIGABRT
+ #endif
+ #ifdef SIGABRT
sigaddset(&sigblock_mask,SIGABRT);
- #endif
- #ifdef SIGKILL
+ #endif
+ #ifdef SIGKILL
sigaddset(&sigblock_mask,SIGKILL);
- #endif
- #ifdef SIGTERM
+ #endif
+ #ifdef SIGTERM
sigaddset(&sigblock_mask,SIGTERM);
- #endif
- #ifdef SIGTTOU
- /* always ignored */
+ #endif
+ #ifdef SIGTTOU
+ /* always ignored */
sigaddset(&sigblock_mask,SIGTTOU);
- #endif
+ #endif
}
return sigblock_mask;
}
------------------------------
Message: 5
Date: Tue, 13 Apr 2010 03:25:17 +0000
From: Arseny Slobodyuk <***@users.sourceforge.net>
Subject: clisp/src ChangeLog,1.7304,1.7305 w32shell.c,1.11,1.12
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1WkX-0005tP-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv22177
Modified Files:
ChangeLog w32shell.c
Log Message:
Fixed bug#1481218 - default drive directory not detected in -M argument
Index: w32shell.c
===================================================================
RCS file: /cvsroot/clisp/clisp/src/w32shell.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- w32shell.c 31 Mar 2010 01:12:21 -0000 1.11
+++ w32shell.c 13 Apr 2010 03:25:15 -0000 1.12
@@ -280,13 +280,14 @@
HANDLE h = NULL;
char * nametocheck;
char * nametocheck_end;
+ int name_len;
/* drive|dir1|dir2|name
^nametocheck
^nametocheck_end */
char saved_char;
BOOL next_name = 0;/* if we found an lnk and need to start over */
int try_counter = 33;
- if (strlen(namein) >= MAX_PATH) return FALSE;
+ if ((name_len = strlen(namein)) >= MAX_PATH) return FALSE;
strcpy(nameout,namein);
do { /* whole file names */
next_name = FALSE;
@@ -295,9 +296,26 @@
nametocheck = nameout;
if (((*nametocheck >= 'a' && *nametocheck <= 'z')
|| (*nametocheck >= 'A' && *nametocheck <= 'Z'))
- && nametocheck[1] == ':' && cpslashp(nametocheck[2]))
- /* drive */
- nametocheck += 3;
+ && nametocheck[1] == ':')
+ { if (cpslashp(nametocheck[2])) {
+ /* drive */
+ nametocheck += 3;
+ } else {
+ /* default directory on drive */
+ char drive[4] = "C:.", *name;
+ int default_len;
+ drive[0] = namein[0];
+ if (!GetFullPathName(drive,_MAX_PATH,nameout,&name)
+ || (default_len = strlen(nameout)) + name_len
+ >= _MAX_PATH) return FALSE;
+ nameout[default_len] = '\\';
+ strcpy(nameout + default_len + 1, namein + 2);
+ name_len += default_len - 1; /* Was C:lisp.exe
+ Now C:\clisp\lisp.exe
+ removed 2
+ added default_len + 1 chars */
+ nametocheck += default_len + 1;
+ } }
else if (nametocheck[0]=='\\' && nametocheck[1]=='\\') {
int i;
/* host */
@@ -325,8 +343,8 @@
{ char * cp = nametocheck;
for (;*cp=='.';cp++);
dots_only = !(*cp) && cp > nametocheck; }
- /* Stars in the middle of filename: error
- Stars as pathname: success */
+ /* Asterisks in the middle of filename: error
+ Asterisks as pathname: success */
{ char * cp = nametocheck;
for (;*cp && *cp!='*';cp++);
have_stars = *cp == '*'; }
@@ -350,26 +368,27 @@
h = FindFirstFile(nameout,&wfd);
if (h != INVALID_HANDLE_VALUE) {
/* make space for full (non 8.3) name component */
- int l = strlen(wfd.cFileName);
+ int l = strlen(wfd.cFileName),
+ oldl = nametocheck_end - nametocheck,
+ new_name_len = name_len + l - oldl;
FindClose(h);
- if (l != (nametocheck_end - nametocheck)) {
+ if (new_name_len >= _MAX_PATH) return FALSE;
+ if (l != oldl) {
int restlen =
- saved_char?(strlen(nametocheck_end+1)
- +1/*saved_char*/+1/*zero byte*/)
- :0;
- if (nametocheck - nameout + restlen + l + 2 > MAX_PATH)
- return FALSE;
- if (restlen) memmove(nametocheck+l,nametocheck_end,restlen);
+ saved_char?(name_len - (nametocheck_end - nameout)):0;
+ memmove(nametocheck+l,nametocheck_end,restlen);
}
strncpy(nametocheck,wfd.cFileName,l);
nametocheck_end = nametocheck + l;
+ name_len = new_name_len;
} else {/* try shortcut
- Note: In something\cyglink.lnk filename isn't resolved
- so one can read/write symlink .lnk files although
- they are not in DIRECTORY output.
+ Note: something\cyglink.lnk doesn't resolve to the contents
+ of cyglink.lnk so one can read/write symlink .lnk
+ files although they are not present in DIRECTORY output.
Is it bug or feature? */
char saved[4];
char resolved[MAX_PATH];
+ int resolved_len;
shell_shortcut_target_t rresult;
if (nametocheck_end - nameout + 4 > MAX_PATH) return FALSE;
strncpy(saved,nametocheck_end+1,4);
@@ -383,13 +402,15 @@
|| (saved_char ? rresult == shell_shortcut_file
: rresult == shell_shortcut_directory))
return FALSE;
+ resolved_len = strlen(resolved);
if (saved_char) {
/*need to subst nameout..nametocheck-1 with resolved path */
- int l1 = strlen(resolved);
- int l2 = strlen(nametocheck_end + 1);
- if (l1 + l2 + 2 > MAX_PATH) return FALSE;
- strncat(resolved,nametocheck_end + 1,l2+1);
+ int l2 = name_len - (nametocheck_end - nameout);
+ if (resolved_len + l2 + 2 > MAX_PATH) return FALSE;
+ strncpy(resolved + resolved_len, nametocheck_end + 1, l2);
+ name_len = l2 - 1;
}
+ name_len += resolved_len;
strcpy(nameout,resolved);
next_name = TRUE;
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7304
retrieving revision 1.7305
diff -u -d -r1.7304 -r1.7305
--- ChangeLog 12 Apr 2010 19:37:37 -0000 1.7304
+++ ChangeLog 13 Apr 2010 03:25:14 -0000 1.7305
@@ -1,3 +1,13 @@
+2010-04-13 Arseny Slobodyuk <***@users.sourceforge.net>
+
+ Fix for a bug#1481218 with default drive directory:
+ within CLISP default_directory_of() is used to fill missed
+ pathname directory component in pathnames like C:lisp.exe.
+ This functionality now added to real_path as well to
+ support lisp invocation like 'C:\>e:lisp.exe -M e:lispinit.mem'.
+ * w32shell.c (real_path): detect and handle default drive
+ directory references. Optimization: less use of strlen.
+
2010-04-12 Vladimir Tzankov <***@gmail.com>
* spvw_sigterm.d (quit_on_signal_in_progress): move to spvw.d
------------------------------
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
------------------------------
_______________________________________________
clisp-cvs mailing list
clisp-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clisp-cvs
End of clisp-cvs Digest, Vol 48, Issue 5
****************************************
clisp-***@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/clisp-cvs
or, via email, send a message with subject or body 'help' to
clisp-cvs-***@lists.sourceforge.net
You can reach the person managing the list at
clisp-cvs-***@lists.sourceforge.net
When replying, please edit your Subject line so it is more specific
than "Re: Contents of clisp-cvs digest..."
CLISP CVS commits for today
Today's Topics:
1. clisp/src ChangeLog,1.7301,1.7302 spvw.d,1.524,1.525
(Sam Steingold)
2. clisp/src ChangeLog, 1.7302, 1.7303 spvw.d, 1.525, 1.526
spvw_sigterm.d, 1.13, 1.14 (Sam Steingold)
3. clisp/src ChangeLog, 1.7303, 1.7304 spvw.d, 1.526, 1.527
spvw_sigterm.d, 1.14, 1.15 (Vladimir Tzankov)
4. clisp/src spvw.d,1.527,1.528 (Sam Steingold)
5. clisp/src ChangeLog,1.7304,1.7305 w32shell.c,1.11,1.12
(Arseny Slobodyuk)
----------------------------------------------------------------------
Message: 1
Date: Mon, 12 Apr 2010 18:29:34 +0000
From: Sam Steingold <***@users.sourceforge.net>
Subject: clisp/src ChangeLog,1.7301,1.7302 spvw.d,1.524,1.525
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1OO6-0002YM-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9794/src
Modified Files:
ChangeLog spvw.d
Log Message:
(quit_on_signal_in_progress) [MULTITHREAD]: add
(signal_handler_thread) [MULTITHREAD]: fix last patch:
set quit_on_signal_in_progress when terminating
Index: spvw.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw.d,v
retrieving revision 1.524
retrieving revision 1.525
diff -u -d -r1.524 -r1.525
--- spvw.d 4 Mar 2010 21:15:29 -0000 1.524
+++ spvw.d 12 Apr 2010 18:29:32 -0000 1.525
@@ -2491,7 +2491,7 @@
if (asciz_equal(arg,"-help-image")) {
p2->argv_help_image = true;
break;
- } else if (arg[2] != 0)
+ } else if (arg[2] != 0)
INVALID_ARG(arg);
else {
usage(delegating);
@@ -2526,7 +2526,7 @@
case 't': /* traditional, temporary directory */
if (asciz_equal(arg,"-traditional"))
p2->argv_ansi = 2; /* traditional */
- else
+ else
INVALID_ARG(arg);
break;
case 'd': /* -d (developer mode) or -disable-readline */
@@ -2534,7 +2534,7 @@
disable_readline = true;
else if (arg[2] == '\0')
p2->argv_developer = true;
- else
+ else
INVALID_ARG(arg);
break;
case 'B': /* lisplibdir */
@@ -2548,7 +2548,7 @@
case 'n':
if (asciz_equal(arg,"-norc"))
p2->argv_norc = true;
- else
+ else
INVALID_ARG(arg);
break;
#if defined(UNIX) || defined(WIN32_NATIVE)
@@ -2590,39 +2590,39 @@
argv_encoding_file = argv_encoding_pathname =
argv_encoding_terminal = argv_encoding_foreign =
argv_encoding_misc = *argptr++;
- else
+ else
INVALID_ARG(arg);
break;
case 'q': /* verbosity level */
p2->argv_verbose--;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case 'v': /* verbosity level */
p2->argv_verbose++;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case 'I': /* ILISP-friendly */
ilisp_mode = true;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case 'C': /* set *LOAD-COMPILING* */
p2->argv_load_compiling = true;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case 'r': /* -repl */
if (asciz_equal(&arg[1],"repl"))
p2->argv_repl = true;
- else
+ else
INVALID_ARG(arg);
break;
case 'i': /* initialization files */
if (arg[2] == '\0')
argv_for = for_init;
- else
+ else
INVALID_ARG(arg);
break;
case 'c': /* files to be compiled */
@@ -2630,10 +2630,10 @@
argv_for = for_compile;
if (arg[2] == 'l') {
p2->argv_compile_listing = true;
- if (arg[3] != '\0')
+ if (arg[3] != '\0')
INVALID_ARG(arg);
} else {
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
}
break;
@@ -2642,14 +2642,14 @@
p2->argv_compile_listing = true;
else if (arg[2] == 'p' && arg[3] == 0) {
argv_for = for_load_path;
- } else
+ } else
INVALID_ARG(arg);
break;
case 'o':
if (asciz_equal(&arg[1],"on-error")) {
if (argptr < argptr_limit)
arg = *argptr++;
- else
+ else
INVALID_ARG(arg);
if (asciz_equal(arg,"default"))
p2->argv_on_error = ON_ERROR_DEFAULT;
@@ -2668,10 +2668,10 @@
} else if (arg[2] == '\0') { /* target for files to be compiled */
OPTION_ARG;
if (!((p2->argv_compile_filecount > 0)
- && (p2->argv_compile_files[p2->argv_compile_filecount-1].output_file==NULL)))
+ && (p2->argv_compile_files[p2->argv_compile_filecount-1].output_file==NULL)))
INVALID_ARG(arg);
p2->argv_compile_files[p2->argv_compile_filecount-1].output_file = arg;
- } else
+ } else
INVALID_ARG(arg);
break;
case 'p': /* package: when repeated, only the last one counts. */
@@ -2681,17 +2681,17 @@
case 'a': /* ANSI CL Compliance */
if (asciz_equal(arg,"-ansi"))
p2->argv_ansi = 1; /* ANSI */
- else
+ else
INVALID_ARG(arg);
break;
case 'x': /* execute LISP-expression */
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
argv_for = for_expr;
break;
case 'w': /* wait for keypress after termination */
p2->argv_wait_keypress = true;
- if (arg[2] != '\0')
+ if (arg[2] != '\0')
INVALID_ARG(arg);
break;
case '-': /* -- GNU-style long options */
@@ -4547,6 +4547,7 @@
/* UP: The signal handler in MT build.
arg: not used. */
+global bool quit_on_signal_in_progress = false;local void *signal_handler_thread(void *arg)
{
while (1) {
@@ -4659,6 +4660,7 @@
break;
#endif
default:
+ quit_on_signal_in_progress = true;
/* just terminate all threads - the last one will
kill the process from delete_thread */
WITH_STOPPED_WORLD(false,{
Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7301
retrieving revision 1.7302
diff -u -d -r1.7301 -r1.7302
--- ChangeLog 11 Apr 2010 20:29:47 -0000 1.7301
+++ ChangeLog 12 Apr 2010 18:29:32 -0000 1.7302
@@ -1,3 +1,9 @@
+2010-04-12 Sam Steingold <***@gnu.org>
+
+ * spvw.d (quit_on_signal_in_progress) [MULTITHREAD]: add
+ (signal_handler_thread) [MULTITHREAD]: fix last patch:
+ set quit_on_signal_in_progress when terminating
+
2010-04-11 Sam Steingold <***@gnu.org>
fix bug#2795278: when quitting on signals, do not enter the debugger
------------------------------
Message: 2
Date: Mon, 12 Apr 2010 18:45:22 +0000
From: Sam Steingold <***@users.sourceforge.net>
Subject: clisp/src ChangeLog, 1.7302, 1.7303 spvw.d, 1.525, 1.526
spvw_sigterm.d, 1.13, 1.14
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1OdP-000459-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15680/src
Modified Files:
ChangeLog spvw.d spvw_sigterm.d
Log Message:
define quit_on_signal_in_progress just once, in spvw_sigterm,
independent of MULTITHREAD
Index: spvw_sigterm.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw_sigterm.d,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- spvw_sigterm.d 11 Apr 2010 20:29:48 -0000 1.13
+++ spvw_sigterm.d 12 Apr 2010 18:45:20 -0000 1.14
@@ -1,4 +1,8 @@
/* Handling of terminating signals. */
+
+/* MULTITHREAD: set in spvw.d:signal_handler_thread() */
+global bool quit_on_signal_in_progress = false;
+
#if !defined(MULTITHREAD)
/* --------------------------- Specification ----------------------------- */
@@ -42,7 +46,6 @@
}
-global bool quit_on_signal_in_progress = false;
/* print the "exiting" message and quit */
local void quit_on_signal (int sig) {
#ifndef NO_ASYNC_INTERRUPTS
Index: spvw.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw.d,v
retrieving revision 1.525
retrieving revision 1.526
diff -u -d -r1.525 -r1.526
--- spvw.d 12 Apr 2010 18:29:32 -0000 1.525
+++ spvw.d 12 Apr 2010 18:45:20 -0000 1.526
@@ -4547,7 +4547,6 @@
/* UP: The signal handler in MT build.
arg: not used. */
-global bool quit_on_signal_in_progress = false;local void *signal_handler_thread(void *arg)
{
while (1) {
Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7302
retrieving revision 1.7303
diff -u -d -r1.7302 -r1.7303
--- ChangeLog 12 Apr 2010 18:29:32 -0000 1.7302
+++ ChangeLog 12 Apr 2010 18:45:20 -0000 1.7303
@@ -1,7 +1,7 @@
2010-04-12 Sam Steingold <***@gnu.org>
- * spvw.d (quit_on_signal_in_progress) [MULTITHREAD]: add
- (signal_handler_thread) [MULTITHREAD]: fix last patch:
+ * spvw_sigterm.d (quit_on_signal_in_progress): always define
+ * spvw.d (signal_handler_thread) [MULTITHREAD]: fix last patch:
set quit_on_signal_in_progress when terminating
2010-04-11 Sam Steingold <***@gnu.org>
------------------------------
Message: 3
Date: Mon, 12 Apr 2010 19:37:40 +0000
From: Vladimir Tzankov <***@users.sourceforge.net>
Subject: clisp/src ChangeLog, 1.7303, 1.7304 spvw.d, 1.526, 1.527
spvw_sigterm.d, 1.14, 1.15
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1PS0-0000LT-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv843/src
Modified Files:
ChangeLog spvw.d spvw_sigterm.d
Log Message:
[MULTITHREAD]: fix process exit code on terminating signals
Index: spvw_sigterm.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw_sigterm.d,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- spvw_sigterm.d 12 Apr 2010 18:45:20 -0000 1.14
+++ spvw_sigterm.d 12 Apr 2010 19:37:38 -0000 1.15
@@ -1,8 +1,6 @@
/* Handling of terminating signals. */
-/* MULTITHREAD: set in spvw.d:signal_handler_thread() */
-global bool quit_on_signal_in_progress = false;
-
+/* in MT signals are handled in spvw.d:signal_handler_thread()*/
#if !defined(MULTITHREAD)
/* --------------------------- Specification ----------------------------- */
Index: spvw.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw.d,v
retrieving revision 1.526
retrieving revision 1.527
diff -u -d -r1.526 -r1.527
--- spvw.d 12 Apr 2010 18:45:20 -0000 1.526
+++ spvw.d 12 Apr 2010 19:37:37 -0000 1.527
@@ -3904,6 +3904,7 @@
quit();
final_exitcode: 0 on normal exit, 1 on abort */
global int final_exitcode = 0;+global bool quit_on_signal_in_progress = false;
local int quit_retry = 0;
nonreturning_function(global, quit, (void)) {
/* first "unwind" the STACK downto STACK-end: */
@@ -4280,27 +4281,35 @@
sigaddset(&sigblock_mask,SIGINT);
sigaddset(&sigblock_mask,SIGALRM);
sigaddset(&sigblock_mask,SIG_TIMEOUT_CALL);
+ #if defined(SIGWINCH)
+ sigaddset(&sigblock_mask,SIGWINCH);
+ #endif
+ /* following are terminating signals - handle them only if we are not
+ already being killed*/
+ if (!quit_on_signal_in_progress) {
#ifdef SIGHUP
- sigaddset(&sigblock_mask,SIGHUP);
+ sigaddset(&sigblock_mask,SIGHUP);
#endif
#ifdef SIGQUIT
- sigaddset(&sigblock_mask,SIGQUIT);
+ sigaddset(&sigblock_mask,SIGQUIT);
#endif
#ifdef SIGILL
- sigaddset(&sigblock_mask,SIGILL);
+ sigaddset(&sigblock_mask,SIGILL);
#endif
#ifdef SIGABRT
- sigaddset(&sigblock_mask,SIGABRT);
+ sigaddset(&sigblock_mask,SIGABRT);
#endif
#ifdef SIGKILL
- sigaddset(&sigblock_mask,SIGKILL);
+ sigaddset(&sigblock_mask,SIGKILL);
#endif
#ifdef SIGTERM
- sigaddset(&sigblock_mask,SIGTERM);
+ sigaddset(&sigblock_mask,SIGTERM);
#endif
- #if defined(SIGWINCH)
- sigaddset(&sigblock_mask,SIGWINCH);
+ #ifdef SIGTTOU
+ /* always ignored */
+ sigaddset(&sigblock_mask,SIGTTOU);
#endif
+ }
return sigblock_mask;
}
@@ -4659,12 +4668,14 @@
break;
#endif
default:
- quit_on_signal_in_progress = true;
/* just terminate all threads - the last one will
kill the process from delete_thread */
+ fprintf(stderr, "Exiting on signal %d\n", sig);
WITH_STOPPED_WORLD(false,{
- var bool some_failed=true;
+ var bool all_succeeded = true;
ENABLE_DUMMY_ALLOCCOUNT(true);
+ quit_on_signal_in_progress = true;
+ final_exitcode = -sig; /* set process exit code */
for_all_threads({
/* be sure the signal handler can be reentered */
spinlock_acquire(&thread->_signal_reenter_ok);
@@ -4672,12 +4683,12 @@
NC_pushSTACK(thread->_STACK,S(thread_throw_tag)); /* %THROW-TAG */
NC_pushSTACK(thread->_STACK,posfixnum(1)); /* 1 argument */
NC_pushSTACK(thread->_STACK,T); /* do not defer the interrupt */
- some_failed &= interrupt_thread(thread);
+ all_succeeded &= interrupt_thread(thread);
});
- if (some_failed) {
+ if (!all_succeeded) {
fputs("*** some threads were not signaled to terminate.",stderr);
- exit(sig); /* nothing we can do - exit immediately (cannot call quit
- from here) */
+ exit(-sig); /* nothing we can do - exit immediately (cannot call quit
+ from here) */
}
ENABLE_DUMMY_ALLOCCOUNT(false);
});
Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7303
retrieving revision 1.7304
diff -u -d -r1.7303 -r1.7304
--- ChangeLog 12 Apr 2010 18:45:20 -0000 1.7303
+++ ChangeLog 12 Apr 2010 19:37:37 -0000 1.7304
@@ -1,3 +1,13 @@
+2010-04-12 Vladimir Tzankov <***@gmail.com>
+
+ * spvw_sigterm.d (quit_on_signal_in_progress): move to spvw.d
+ * spvw.d (quit_on_signal_in_progress): define it here
+ (async_signal_mask) [POSIX_THREADS]: do not add terminating signals if
+ process was already signaled with one of them
+ (signal_handler_thread): set proper exit code on terminating signal.
+ print to stderr "Exiting on signal ...". fix erroneous message on
+ terminating signal
+
2010-04-12 Sam Steingold <***@gnu.org>
* spvw_sigterm.d (quit_on_signal_in_progress): always define
------------------------------
Message: 4
Date: Mon, 12 Apr 2010 20:23:24 +0000
From: Sam Steingold <***@users.sourceforge.net>
Subject: clisp/src spvw.d,1.527,1.528
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1QAG-0004IY-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv16513
Modified Files:
spvw.d
Log Message:
indentation
Index: spvw.d
===================================================================
RCS file: /cvsroot/clisp/clisp/src/spvw.d,v
retrieving revision 1.527
retrieving revision 1.528
diff -u -d -r1.527 -r1.528
--- spvw.d 12 Apr 2010 19:37:37 -0000 1.527
+++ spvw.d 12 Apr 2010 20:23:22 -0000 1.528
@@ -4281,34 +4281,34 @@
sigaddset(&sigblock_mask,SIGINT);
sigaddset(&sigblock_mask,SIGALRM);
sigaddset(&sigblock_mask,SIG_TIMEOUT_CALL);
- #if defined(SIGWINCH)
- sigaddset(&sigblock_mask,SIGWINCH);
- #endif
+ #if defined(SIGWINCH)
+ sigaddset(&sigblock_mask,SIGWINCH);
+ #endif
/* following are terminating signals - handle them only if we are not
already being killed*/
if (!quit_on_signal_in_progress) {
- #ifdef SIGHUP
+ #ifdef SIGHUP
sigaddset(&sigblock_mask,SIGHUP);
- #endif
- #ifdef SIGQUIT
+ #endif
+ #ifdef SIGQUIT
sigaddset(&sigblock_mask,SIGQUIT);
- #endif
- #ifdef SIGILL
+ #endif
+ #ifdef SIGILL
sigaddset(&sigblock_mask,SIGILL);
- #endif
- #ifdef SIGABRT
+ #endif
+ #ifdef SIGABRT
sigaddset(&sigblock_mask,SIGABRT);
- #endif
- #ifdef SIGKILL
+ #endif
+ #ifdef SIGKILL
sigaddset(&sigblock_mask,SIGKILL);
- #endif
- #ifdef SIGTERM
+ #endif
+ #ifdef SIGTERM
sigaddset(&sigblock_mask,SIGTERM);
- #endif
- #ifdef SIGTTOU
- /* always ignored */
+ #endif
+ #ifdef SIGTTOU
+ /* always ignored */
sigaddset(&sigblock_mask,SIGTTOU);
- #endif
+ #endif
}
return sigblock_mask;
}
------------------------------
Message: 5
Date: Tue, 13 Apr 2010 03:25:17 +0000
From: Arseny Slobodyuk <***@users.sourceforge.net>
Subject: clisp/src ChangeLog,1.7304,1.7305 w32shell.c,1.11,1.12
To: clisp-***@lists.sourceforge.net
Message-ID: <E1O1WkX-0005tP-***@sfp-cvsdas-2.v30.ch3.sourceforge.com>
Update of /cvsroot/clisp/clisp/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv22177
Modified Files:
ChangeLog w32shell.c
Log Message:
Fixed bug#1481218 - default drive directory not detected in -M argument
Index: w32shell.c
===================================================================
RCS file: /cvsroot/clisp/clisp/src/w32shell.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- w32shell.c 31 Mar 2010 01:12:21 -0000 1.11
+++ w32shell.c 13 Apr 2010 03:25:15 -0000 1.12
@@ -280,13 +280,14 @@
HANDLE h = NULL;
char * nametocheck;
char * nametocheck_end;
+ int name_len;
/* drive|dir1|dir2|name
^nametocheck
^nametocheck_end */
char saved_char;
BOOL next_name = 0;/* if we found an lnk and need to start over */
int try_counter = 33;
- if (strlen(namein) >= MAX_PATH) return FALSE;
+ if ((name_len = strlen(namein)) >= MAX_PATH) return FALSE;
strcpy(nameout,namein);
do { /* whole file names */
next_name = FALSE;
@@ -295,9 +296,26 @@
nametocheck = nameout;
if (((*nametocheck >= 'a' && *nametocheck <= 'z')
|| (*nametocheck >= 'A' && *nametocheck <= 'Z'))
- && nametocheck[1] == ':' && cpslashp(nametocheck[2]))
- /* drive */
- nametocheck += 3;
+ && nametocheck[1] == ':')
+ { if (cpslashp(nametocheck[2])) {
+ /* drive */
+ nametocheck += 3;
+ } else {
+ /* default directory on drive */
+ char drive[4] = "C:.", *name;
+ int default_len;
+ drive[0] = namein[0];
+ if (!GetFullPathName(drive,_MAX_PATH,nameout,&name)
+ || (default_len = strlen(nameout)) + name_len
+ >= _MAX_PATH) return FALSE;
+ nameout[default_len] = '\\';
+ strcpy(nameout + default_len + 1, namein + 2);
+ name_len += default_len - 1; /* Was C:lisp.exe
+ Now C:\clisp\lisp.exe
+ removed 2
+ added default_len + 1 chars */
+ nametocheck += default_len + 1;
+ } }
else if (nametocheck[0]=='\\' && nametocheck[1]=='\\') {
int i;
/* host */
@@ -325,8 +343,8 @@
{ char * cp = nametocheck;
for (;*cp=='.';cp++);
dots_only = !(*cp) && cp > nametocheck; }
- /* Stars in the middle of filename: error
- Stars as pathname: success */
+ /* Asterisks in the middle of filename: error
+ Asterisks as pathname: success */
{ char * cp = nametocheck;
for (;*cp && *cp!='*';cp++);
have_stars = *cp == '*'; }
@@ -350,26 +368,27 @@
h = FindFirstFile(nameout,&wfd);
if (h != INVALID_HANDLE_VALUE) {
/* make space for full (non 8.3) name component */
- int l = strlen(wfd.cFileName);
+ int l = strlen(wfd.cFileName),
+ oldl = nametocheck_end - nametocheck,
+ new_name_len = name_len + l - oldl;
FindClose(h);
- if (l != (nametocheck_end - nametocheck)) {
+ if (new_name_len >= _MAX_PATH) return FALSE;
+ if (l != oldl) {
int restlen =
- saved_char?(strlen(nametocheck_end+1)
- +1/*saved_char*/+1/*zero byte*/)
- :0;
- if (nametocheck - nameout + restlen + l + 2 > MAX_PATH)
- return FALSE;
- if (restlen) memmove(nametocheck+l,nametocheck_end,restlen);
+ saved_char?(name_len - (nametocheck_end - nameout)):0;
+ memmove(nametocheck+l,nametocheck_end,restlen);
}
strncpy(nametocheck,wfd.cFileName,l);
nametocheck_end = nametocheck + l;
+ name_len = new_name_len;
} else {/* try shortcut
- Note: In something\cyglink.lnk filename isn't resolved
- so one can read/write symlink .lnk files although
- they are not in DIRECTORY output.
+ Note: something\cyglink.lnk doesn't resolve to the contents
+ of cyglink.lnk so one can read/write symlink .lnk
+ files although they are not present in DIRECTORY output.
Is it bug or feature? */
char saved[4];
char resolved[MAX_PATH];
+ int resolved_len;
shell_shortcut_target_t rresult;
if (nametocheck_end - nameout + 4 > MAX_PATH) return FALSE;
strncpy(saved,nametocheck_end+1,4);
@@ -383,13 +402,15 @@
|| (saved_char ? rresult == shell_shortcut_file
: rresult == shell_shortcut_directory))
return FALSE;
+ resolved_len = strlen(resolved);
if (saved_char) {
/*need to subst nameout..nametocheck-1 with resolved path */
- int l1 = strlen(resolved);
- int l2 = strlen(nametocheck_end + 1);
- if (l1 + l2 + 2 > MAX_PATH) return FALSE;
- strncat(resolved,nametocheck_end + 1,l2+1);
+ int l2 = name_len - (nametocheck_end - nameout);
+ if (resolved_len + l2 + 2 > MAX_PATH) return FALSE;
+ strncpy(resolved + resolved_len, nametocheck_end + 1, l2);
+ name_len = l2 - 1;
}
+ name_len += resolved_len;
strcpy(nameout,resolved);
next_name = TRUE;
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v
retrieving revision 1.7304
retrieving revision 1.7305
diff -u -d -r1.7304 -r1.7305
--- ChangeLog 12 Apr 2010 19:37:37 -0000 1.7304
+++ ChangeLog 13 Apr 2010 03:25:14 -0000 1.7305
@@ -1,3 +1,13 @@
+2010-04-13 Arseny Slobodyuk <***@users.sourceforge.net>
+
+ Fix for a bug#1481218 with default drive directory:
+ within CLISP default_directory_of() is used to fill missed
+ pathname directory component in pathnames like C:lisp.exe.
+ This functionality now added to real_path as well to
+ support lisp invocation like 'C:\>e:lisp.exe -M e:lispinit.mem'.
+ * w32shell.c (real_path): detect and handle default drive
+ directory references. Optimization: less use of strlen.
+
2010-04-12 Vladimir Tzankov <***@gmail.com>
* spvw_sigterm.d (quit_on_signal_in_progress): move to spvw.d
------------------------------
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
------------------------------
_______________________________________________
clisp-cvs mailing list
clisp-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/clisp-cvs
End of clisp-cvs Digest, Vol 48, Issue 5
****************************************