which included commits to RCS files with non-trunk default branches.
Much general information is in INSTALL. If it's covered in
INSTALL, we don't repeat it here.
+*** X11/bitmaps/gray (or other X11-related file) not found.
+
+The X11R6 distribution was monolithic, but the X11R7 distribution is
+much more modular. Many OS distributions omit these bitmaps (assuming
+nobody uses them, evidently). Your OS distribution should have a
+developer's package containing these files, probably with a name
+containing the string "bitmap". Known package names (you may need to
+add an extension such as .deb or .rpm) include x11/xbitmaps (Ubuntu)
+and xorg-x11-xbitmaps (Fedora Core 5).
+
*** How do I configure to get the buffer tabs/progress bars?
These features depend on support for "native widgets". Use the
+2006-12-09 Vin Shelton <acs@xemacs.org>
+
+ * XEmacs 21.4.20 is released
+
+2006-08-11 Jerry James <james@xemacs.org>
+
+ * gnuslib.c (disconnect_from_server): shutdown() has been fine on
+ Linux for a long time now; use it. Also, don't use length to
+ access the buffer unless it is positive, not just nonzero.
+ * gnuclient.c (filename_expand): Initialize the last array element
+ to get a valid C string in case of overflow. Use strncat to avoid
+ buffer overruns.
+ * gnuclient.c (main): Use strncpy to avoid buffer overruns.
+
+2006-08-11 Jerry James <james@xemacs.org>
+
+ * pop.h: Sync with Emacs.
+ * pop.c: Ditto.
+
+2006-07-21 Stephen J. Turnbull <stephen@xemacs.org>
+
+ * etags.c: Xemacs -> XEmacs
+
2006-01-28 Vin Shelton <acs@xemacs.org>
* XEmacs 21.4.19 is released
# define _GNU_SOURCE 1 /* enables some compiler checks on GNU */
#endif
-/* WIN32_NATIVE is for Xemacs.
+/* WIN32_NATIVE is for XEmacs.
MSDOS, WINDOWSNT, DOS_NT are for Emacs. */
#ifdef WIN32_NATIVE
# undef MSDOS
#endif
int len;
- fullpath[0] = '\0';
+ fullpath[0] = fullpath[MAXPATHLEN] = '\0';
#ifdef CYGWIN
/*
if (filename[0] && filename[0] == '/')
{
/* Absolute (unix-style) pathname. Do nothing */
- strcat (fullpath, filename);
+ strncat (fullpath, filename, MAXPATHLEN);
}
else
{
and prepend it. FIXME: need to fix the case of DOS paths like
"\foo", where we need to get the current drive. */
- strcat (fullpath, get_current_working_directory ());
+ strncat (fullpath, get_current_working_directory (), MAXPATHLEN);
len = strlen (fullpath);
- if (len > 0 && fullpath[len-1] == '/') /* trailing slash already? */
- ; /* yep */
- else
- strcat (fullpath, "/"); /* nope, append trailing slash */
+ /* If no trailing slash, add one */
+ if (len <= 0 || (fullpath[len - 1] != '/' && len < MAXPATHLEN))
+ {
+ strcat (fullpath, "/");
+ len++;
+ }
+
/* Don't forget to add the filename! */
- strcat (fullpath,filename);
+ strncat (fullpath, filename, MAXPATHLEN - len);
}
} /* filename_expand */
break;
case 'r':
GET_ARGUMENT (remotearg, "-r");
- strcpy (remotepath, remotearg);
+ strncpy (remotepath, remotearg, MAXPATHLEN);
rflg = 1;
break;
#endif /* INTERNET_DOMAIN_SOCKETS */
* to this machine */
if ((ptr = getenv ("GNU_NODE")) != NULL)
/* user specified a path */
- strcpy (remotepath, ptr);
+ strncpy (remotepath, ptr, MAXPATHLEN);
}
#if 0 /* This is really bogus... re-enable it if you must have it! */
#if defined (hp9000s300) || defined (hp9000s800)
send_string(s,EOT_STR); /* make sure server gets string */
-#if !defined (linux) && !defined (_SCO_DS)
+#if !defined (_SCO_DS)
/*
- * shutdown is completely hozed under linux. If s is a unix domain socket,
- * you'll get EOPNOTSUPP back from it. If s is an internet socket, you get
- * a broken pipe when you try to read a bit later. The latter
- * problem is fixed for linux versions >= 1.1.46, but the problem
- * with unix sockets persists. Sigh.
+ * There used to be a comment here complaining about ancient Linux
+ * versions. It is no longer relevant. I don't know why _SCO_DS is
+ * verboten here, as the original comment did not say.
*/
if (shutdown(s,1) == -1) {
#else
while ((length = read(s,buffer,GSERV_BUFSZ)) > 0 ||
(length == -1 && errno == EINTR)) {
- if (length) {
+ if (length > 0) {
buffer[length] = '\0';
if (echo) {
fputs(buffer,stdout);
/* pop.c: client routines for talking to a POP3-protocol post-office server
- Copyright (c) 1991, 1993, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 1996, 1997, 1999, 2002, 2003, 2004,
+ 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001 Ben Wing.
Written by Jonathan Kamens, jik@security.ov.com.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* Synched up with: FSF 22.0.50. */
#ifdef HAVE_CONFIG_H
#define NO_SHORTNAMES /* Tell config not to load remap.h */
#ifdef KERBEROS
#ifndef KRB5
extern int krb_sendauth (/* long, int, KTEXT, char *, char *, char *,
- unsigned long, MSG_DAT *, CREDENTIALS *, Key_schedule,
+ u_long, MSG_DAT *, CREDENTIALS *, Key_schedule,
struct sockaddr_in *, struct sockaddr_in *,
char * */);
extern char *krb_realmofhost (/* char * */);
#endif
static int socket_connection (char *, int);
-static char *pop_getline (popserver);
+static int pop_getline (popserver, char **);
static int sendline (popserver, char *);
static int fullwrite (int, char *, int);
static int getok (popserver);
static int gettermination (popserver);
#endif
static void pop_trash (popserver);
-static char *find_crlf (char *);
+static char *find_crlf (char *, int);
-#define ERROR_MAX 80 /* a pretty arbitrary size */
+#define ERROR_MAX 160 /* a pretty arbitrary size, but needs
+ to be bigger than the original
+ value of 80 */
#define POP_PORT 110
#define KPOP_PORT 1109
#if defined(WIN32_NATIVE) || defined(CYGWIN)
#endif
#ifdef KERBEROS
#ifdef KRB5
-#define KPOP_SERVICE "k5pop";
+#define KPOP_SERVICE "k5pop"
#else
#define KPOP_SERVICE "kpop"
#endif
return (-1);
}
- if (sendline (server, "STAT") || (! (fromserver = pop_getline (server))))
+ if (sendline (server, "STAT") || (pop_getline (server, &fromserver) < 0))
return (-1);
if (strncmp (fromserver, "+OK ", 4))
free ((char *) *sizes);
return (-1);
}
- if (! (fromserver = pop_getline (server)))
+ if (pop_getline (server, &fromserver) < 0)
{
free ((char *) *IDs);
free ((char *) *sizes);
}
for (i = 0; i < how_many; i++)
{
- if (pop_multi_next (server, &fromserver))
+ if (pop_multi_next (server, &fromserver) <= 0)
{
free ((char *) *IDs);
free ((char *) *sizes);
}
(*sizes)[i] = atoi (fromserver);
}
- if (pop_multi_next (server, &fromserver))
+ if (pop_multi_next (server, &fromserver) < 0)
{
free ((char *) *IDs);
free ((char *) *sizes);
* markfrom
* If true, then mark the string "From " at the beginning
* of lines with '>'.
+ * msg_buf Output parameter to which a buffer containing the
+ * message is assigned.
*
- * Return value: A string pointing to the message, if successful, or
- * null with pop_error set if not.
+ * Return value: The number of bytes in msg_buf, which may contain
+ * embedded nulls, not including its final null, or -1 on error
+ * with pop_error set.
*
* Side effects: May kill connection on error.
*/
-char *
-pop_retrieve (popserver server, int message, int markfrom)
+int
+pop_retrieve (popserver server, int message, int markfrom, char **msg_buf)
{
int *IDs, *sizes, bufsize, fromcount = 0, cp = 0;
char *ptr, *fromserver;
}
if (pop_list (server, message, &IDs, &sizes))
- return (0);
+ return (-1);
if (pop_retrieve_first (server, message, &fromserver))
{
- return (0);
+ return (-1);
}
/*
{
strcpy (pop_error, "Out of memory in pop_retrieve");
pop_retrieve_flush (server);
- return (0);
+ return (-1);
}
- while (! (ret = pop_retrieve_next (server, &fromserver)))
+ while ((ret = pop_retrieve_next (server, &fromserver)) >= 0)
{
- int linesize;
-
if (! fromserver)
{
ptr[cp] = '\0';
- return (ptr);
+ *msg_buf = ptr;
+ return (cp);
}
if (markfrom && fromserver[0] == 'F' && fromserver[1] == 'r' &&
fromserver[2] == 'o' && fromserver[3] == 'm' &&
{
strcpy (pop_error, "Out of memory in pop_retrieve");
pop_retrieve_flush (server);
- return (0);
+ return (-1);
}
fromcount = 0;
}
ptr[cp++] = '>';
}
- linesize = strlen (fromserver);
- memcpy (&ptr[cp], fromserver, linesize);
- cp += linesize;
+ memcpy (&ptr[cp], fromserver, ret);
+ cp += ret;
ptr[cp++] = '\n';
}
- if (ret)
- {
- free (ptr);
- /* return (0); */
- }
- /* This function used to fall off the end, but that doesn't make any sense */
- return (0);
+ free (ptr);
+ return (-1);
}
int
return (pop_multi_first (server, pop_error, response));
}
+/*
+ Returns a negative number on error, 0 to indicate that the data has
+ all been read (i.e., the server has returned a "." termination
+ line), or a positive number indicating the number of bytes in the
+ returned buffer (which is null-terminated and may contain embedded
+ nulls, but the returned bytecount doesn't include the final null).
+ */
+
int
pop_retrieve_next (popserver server, char **line)
{
return (pop_multi_first (server, pop_error, response));
}
+/*
+ Returns a negative number on error, 0 to indicate that the data has
+ all been read (i.e., the server has returned a "." termination
+ line), or a positive number indicating the number of bytes in the
+ returned buffer (which is null-terminated and may contain embedded
+ nulls, but the returned bytecount doesn't include the final null).
+ */
+
int
pop_top_next (popserver server, char **line)
{
return (-1);
}
- if (sendline (server, command) || (! (*response = pop_getline (server))))
+ if (sendline (server, command) || (pop_getline (server, response) < 0))
{
return (-1);
}
}
}
+/*
+ Read the next line of data from SERVER and place a pointer to it
+ into LINE. Return -1 on error, 0 if there are no more lines to read
+ (i.e., the server has returned a line containing only "."), or a
+ positive number indicating the number of bytes in the LINE buffer
+ (not including the final null). The data in that buffer may contain
+ embedded nulls, but does not contain the final CRLF. When returning
+ 0, LINE is set to null. */
+
int
pop_multi_next (popserver server, char **line)
{
char *fromserver;
+ int ret;
if (! server->in_multi)
{
return (-1);
}
- fromserver = pop_getline (server);
- if (! fromserver)
+ if ((ret = pop_getline (server, &fromserver)) < 0)
{
return (-1);
}
else
{
*line = fromserver + 1;
- return (0);
+ return (ret - 1);
}
}
else
{
*line = fromserver;
- return (0);
+ return (ret);
}
}
pop_multi_flush (popserver server)
{
char *line;
+ int ret;
if (! server->in_multi)
{
return (0);
}
- while (! pop_multi_next (server, &line))
+ while ((ret = pop_multi_next (server, &line)))
{
- if (! line)
+ if (ret < 0)
{
- return (0);
+ return (-1);
}
}
- return (-1);
+ return (0);
}
/* Function: pop_delete
if (sendline (server, "LAST"))
return (-1);
- if (! (fromserver = pop_getline (server)))
+ if (pop_getline (server, &fromserver) < 0)
return (-1);
if (! strncmp (fromserver, "-ERR", 4))
#ifdef KERBEROS
#ifdef KRB5
krb5_error_code rem;
+ krb5_context kcontext = 0;
+ krb5_auth_context auth_context = 0;
krb5_ccache ccdef;
krb5_principal client, server;
krb5_error *err_ret;
CREDENTIALS cred;
Key_schedule schedule;
int rem;
+ char *realhost;
#endif /* KRB5 */
#endif /* KERBEROS */
}
#endif
- do
- {
- hostent = gethostbyname (host);
- try_count++;
- if ((! hostent)
-#ifndef BROKEN_CYGWIN
- && ((h_errno != TRY_AGAIN) || (try_count == 5))
-#endif
- )
- {
- strcpy (pop_error, "Could not determine POP server's address");
- return (-1);
- }
- } while (! hostent);
-
memset (&addr, 0, sizeof (addr));
addr.sin_family = AF_INET;
}
}
-#define SOCKET_ERROR "Could not create socket for POP connection: "
+#define POP_SOCKET_ERROR "Could not create socket for POP connection: "
sock = socket (PF_INET, SOCK_STREAM, 0);
if (sock < 0)
{
- strcpy (pop_error, SOCKET_ERROR);
+ strcpy (pop_error, POP_SOCKET_ERROR);
strncat (pop_error, strerror (errno),
- ERROR_MAX - sizeof (SOCKET_ERROR));
+ ERROR_MAX - sizeof (POP_SOCKET_ERROR));
return (-1);
}
+ do
+ {
+ hostent = gethostbyname (host);
+ try_count++;
+ if ((! hostent)
+#ifndef BROKEN_CYGWIN
+ && ((h_errno != TRY_AGAIN) || (try_count == 5))
+#endif
+ )
+ {
+ strcpy (pop_error, "Could not determine POP server's address");
+ return (-1);
+ }
+ } while (! hostent);
+
while (*hostent->h_addr_list)
{
memcpy (&addr.sin_addr, *hostent->h_addr_list, hostent->h_length);
if (! (flags & POP_NO_KERBEROS))
{
#ifdef KRB5
- krb5_init_ets ();
-
- if (rem = krb5_cc_default (&ccdef))
+ if ((rem = krb5_init_context (&kcontext)))
{
krb5error:
+ if (auth_context)
+ krb5_auth_con_free (kcontext, auth_context);
+ if (kcontext)
+ krb5_free_context (kcontext);
strcpy (pop_error, KRB_ERROR);
strncat (pop_error, error_message (rem),
ERROR_MAX - sizeof(KRB_ERROR));
return (-1);
}
- if (rem = krb5_cc_get_principal (ccdef, &client))
- {
- goto krb5error;
- }
+ if ((rem = krb5_auth_con_init (kcontext, &auth_context)))
+ goto krb5error;
+
+ if (rem = krb5_cc_default (kcontext, &ccdef))
+ goto krb5error;
+
+ if (rem = krb5_cc_get_principal (kcontext, ccdef, &client))
+ goto krb5error;
for (cp = hostent->h_name; *cp; cp++)
{
}
}
- if (rem = krb5_sname_to_principal (hostent->h_name, POP_SERVICE,
- FALSE, &server))
- {
- goto krb5error;
- }
+ if (rem = krb5_sname_to_principal (kcontext, hostent->h_name,
+ POP_SERVICE, FALSE, &server))
+ goto krb5error;
- rem = krb5_sendauth ((krb5_pointer) &sock, "KPOPV1.0", client, server,
+ rem = krb5_sendauth (kcontext, &auth_context,
+ (krb5_pointer) &sock, "KPOPV1.0", client, server,
AP_OPTS_MUTUAL_REQUIRED,
0, /* no checksum */
0, /* no creds, use ccache instead */
ccdef,
- 0, /* don't need seq # */
- 0, /* don't need subsession key */
&err_ret,
+ 0, /* don't need subsession key */
0); /* don't need reply */
- krb5_free_principal (server);
+ krb5_free_principal (kcontext, server);
if (rem)
{
if (err_ret && err_ret->text.length)
ERROR_MAX - sizeof (KRB_ERROR));
}
if (err_ret)
- krb5_free_error (err_ret);
+ krb5_free_error (kcontext, err_ret);
+ krb5_auth_con_free (kcontext, auth_context);
+ krb5_free_context (kcontext);
CLOSESOCKET (sock);
return (-1);
}
#else /* ! KRB5 */
ticket = (KTEXT) malloc (sizeof (KTEXT_ST));
- rem = krb_sendauth (0L, sock, ticket, "pop", hostent->h_name,
- (char *) krb_realmofhost (hostent->h_name),
+ rem = krb_sendauth (0L, sock, ticket, "pop", realhost,
+ (char *) krb_realmofhost (realhost),
(unsigned long) 0, &msg_data, &cred, schedule,
(struct sockaddr_in *) 0,
(struct sockaddr_in *) 0,
"KPOPV0.1");
free ((char *) ticket);
+ free (realhost);
if (rem != KSUCCESS)
{
strcpy (pop_error, KRB_ERROR);
* Arguments:
* server The server from which to get the line of text.
*
- * Returns: A non-null pointer if successful, or a null pointer on any
- * error, with an error message copied into pop_error.
+ * Returns: The number of characters in the line, which is returned in
+ * LINE, not including the final null. A return value of 0
+ * indicates a blank line. A negative return value indicates an
+ * error (in which case the contents of LINE are undefined. In
+ * case of error, an error message is copied into pop_error.
*
* Notes: The line returned is overwritten with each call to pop_getline.
*
* Side effects: Closes the connection on error.
+ *
+ * THE RETURNED LINE MAY CONTAIN EMBEDDED NULLS!
*/
-static char *
-pop_getline (popserver server)
+static int
+pop_getline (popserver server, char **line)
{
#define GETLINE_ERROR "Error reading from server: "
if (server->data)
{
- char *cp = find_crlf (server->buffer + server->buffer_index);
+ char *cp = find_crlf (server->buffer + server->buffer_index,
+ server->data);
if (cp)
{
int found;
server->buffer_index += data_used;
if (pop_debug)
+ /* Embedded nulls will truncate this output prematurely,
+ but that's OK because it's just for debugging anyway. */
fprintf (stderr, "<<< %s\n", server->buffer + found);
- return (server->buffer + found);
+ *line = server->buffer + found;
+ return (data_used - 2);
}
else
{
{
strcpy (pop_error, "Out of memory in pop_getline");
pop_trash (server);
- return (0);
+ return (-1);
}
}
ret = RECV (server->file, server->buffer + server->data,
strncat (pop_error, strerror (errno),
ERROR_MAX - sizeof (GETLINE_ERROR));
pop_trash (server);
- return (0);
+ return (-1);
}
else if (ret == 0)
{
strcpy (pop_error, "Unexpected EOF from server in pop_getline");
pop_trash (server);
- return (0);
+ return (-1);
}
else
{
server->data += ret;
server->buffer[server->data] = '\0';
- cp = find_crlf (server->buffer + search_offset);
+ cp = find_crlf (server->buffer + search_offset,
+ server->data - search_offset);
if (cp)
{
int data_used = (cp + 2) - server->buffer;
if (pop_debug)
fprintf (stderr, "<<< %s\n", server->buffer);
- return (server->buffer);
+ *line = server->buffer;
+ return (data_used - 2);
}
- search_offset += ret;
+ /* As above, the "- 1" here is to account for the fact that
+ we may have read a CR without its accompanying LF. */
+ search_offset += ret - 1;
}
}
{
#define SENDLINE_ERROR "Error writing to POP server: "
int ret;
-
+ char *buf;
+
+ /* Combine the string and the CR-LF into one buffer. Otherwise, two
+ reasonable network stack optimizations, Nagle's algorithm and
+ delayed acks, combine to delay us a fraction of a second on every
+ message we send. (Movemail writes line without \r\n, client
+ kernel sends packet, server kernel delays the ack to see if it
+ can combine it with data, movemail writes \r\n, client kernel
+ waits because it has unacked data already in its outgoing queue,
+ client kernel eventually times out and sends.)
+
+ This can be something like 0.2s per command, which can add up
+ over a few dozen messages, and is a big chunk of the time we
+ spend fetching mail from a server close by. */
+ buf = alloca (strlen (line) + 3);
+ strcpy (buf, line);
+ strcat (buf, "\r\n");
ret = fullwrite (server->file, line, strlen (line));
- if (ret >= 0)
- { /* 0 indicates that a blank line was written */
- ret = fullwrite (server->file, "\r\n", 2);
- }
if (ret < 0)
{
fullwrite (int fd, char *buf, int nbytes)
{
char *cp;
- int ret;
+ int ret = 0;
cp = buf;
- while ((ret = SEND (fd, cp, nbytes, 0)) > 0)
+ while (nbytes && ((ret = SEND (fd, cp, nbytes, 0)) > 0))
{
cp += ret;
nbytes -= ret;
{
char *fromline;
- if (! (fromline = pop_getline (server)))
+ if (pop_getline (server, &fromline) < 0)
{
return (-1);
}
{
char *fromserver;
- fromserver = pop_getline (server);
- if (! fromserver)
+ if (pop_getline (server, &fromserver) < 0)
return (-1);
if (strcmp (fromserver, "."))
#endif
}
-/* Return a pointer to the first CRLF in IN_STRING,
- or 0 if it does not contain one. */
+/* Return a pointer to the first CRLF in IN_STRING, which can contain
+ embedded nulls and has LEN characters in it not including the final
+ null, or 0 if it does not contain one. */
static char *
-find_crlf (char *in_string)
+find_crlf (char *in_string, int len)
{
- while (1)
+ while (len--)
{
- if (! *in_string)
- return (0);
- else if (*in_string == '\r')
+ if (*in_string == '\r')
{
if (*++in_string == '\n')
return (in_string - 1);
else
in_string++;
}
- /* NOTREACHED */
+ return (0);
}
#endif /* MAIL_USE_POP */
/* pop.h: Header file for the "pop.c" client POP3 protocol.
- Copyright (c) 1991,1993 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 2002, 2003, 2004,
+ 2005, 2006 Free Software Foundation, Inc.
Written by Jonathan Kamens, jik@security.ov.com.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* Synched up with: FSF 22.0.50. */
#include <stdio.h>
extern int pop_stat _ARGS((popserver server, int *count, int *size));
extern int pop_list _ARGS((popserver server, int message, int **IDs,
int **size));
-extern char *pop_retrieve _ARGS((popserver server, int message, int markfrom));
+extern int pop_retrieve _ARGS((popserver server, int message, int markfrom,
+ char **));
extern int pop_retrieve_first _ARGS((popserver server, int message,
char **response));
extern int pop_retrieve_next _ARGS((popserver server, char **line));
(list
(concat
"\\<\\("
+ "assert\\|"
"break\\|byvalue\\|"
"case\\|cast\\|catch\\|class\\|continue\\|"
- "do\\|else\\|extends\\|"
+ "do\\|else\\|enum\\|extends\\|"
"finally\\|for\\|future\\|"
"generic\\|goto\\|"
"if\\|implements\\|import\\|"
'("\\(@beaninfo\\)"
0 font-lock-keyword-face t)
;; Doc tag - Links
- '("{ *@link\\s +\\([^}]+\\)}"
+ '("{ *@link\\(?:plain\\)?\\s +\\([^}]+\\)}"
0 font-lock-keyword-face t)
;; Doc tag - Links
- '("{ *@link\\s +\\(\\(\\S +\\)\\|\\(\\S +\\s +\\S +\\)\\) *}"
+ '("{ *@link\\(?:plain\\)?\\s +\\(\\(\\S +\\)\\|\\(\\S +\\s +\\S +\\)\\) *}"
1 font-lock-function-name-face t)
)))
Info-current-subfile nil
Info-current-file-completions nil
Info-index-alternatives nil
- buffer-file-name nil)
+ buffer-file-name nil
+ buffer-file-truename nil)
(erase-buffer)
(if (string= "dir" (file-name-nondirectory filename))
(Info-insert-dir)
(message "Composing main Info directory...done"))
(setq Info-dir-contents (buffer-string)))
(setq default-directory (file-name-as-directory Info-dir-contents-directory))
- (setq buffer-file-name (caar Info-dir-file-attributes)))
+ (setq buffer-file-name (caar Info-dir-file-attributes)
+ buffer-file-truename (file-truename buffer-file-name)))
(defmacro Info-directory-files (dir-file &optional all full nosort files-only)
"Return a list of Info files living in the same directory as DIR-FILE.
(throw 'foo t)))))
(or (equal Info-current-subfile lastfilename)
(let ((buffer-read-only nil))
- (setq buffer-file-name nil)
+ (setq buffer-file-name nil
+ buffer-file-truename nil)
(widen)
(erase-buffer)
(Info-insert-file-contents (Info-suffixed-file
(call-process shell-file-name nil t nil shell-command-switch command)
(message "")
(when visit
- (setq buffer-file-name file)
+ (setq buffer-file-name file
+ buffer-file-truename (file-truename buffer-file-name))
(set-buffer-modified-p nil)
(clear-visited-file-modtime)))
(insert-file-contents file visit))))
\(FILENAME NODENAME BUFFERPOS\)."
(let ((where '())
(cmd-desc (concat "^\\* " (regexp-quote (symbol-name command))
- ":\\s *\\(.*\\)\\.$")))
+ ":\\s *\\(.*\\)\\.")))
(save-excursion
(Info-find-node "XEmacs" "Command Index")
;; Take the index node off the Info history.
; ("Japan (nucba.ac.jp)" "mirror.nucba.ac.jp" "mirror/xemacs/packages")
("Japan (sut.ac.jp)" "sunsite.sut.ac.jp" "pub/archives/packages/xemacs/packages")
("Korea (kr.xemacs.org)" "ftp.kr.xemacs.org" "pub/tools/emacs/xemacs/packages")
+ ("Netherlands (nl.xemacs.org)" "ftp.nl.xemacs.org" "pub/xemacs/ftp/packages")
("New Zealand (nz.xemacs.org)" "ftp.nz.xemacs.org" "mirror/ftp.xemacs.org/packages")
("Norway (no.xemacs.org)" "ftp.no.xemacs.org" "pub/xemacs/packages")
("Poland (pl.xemacs.org)" "ftp.pl.xemacs.org" "pub/unix/editors/xemacs/packages")
"pub/archives/packages/xemacs/xemacs-21.5/experimental/packages")
("Korea (kr.xemacs.org)" "ftp.kr.xemacs.org"
"pub/tools/emacs/xemacs/beta/experimental/packages")
+ ("Netherlands (nl.xemacs.org)" "ftp.nl.xemacs.org"
+ "pub/xemacs/ftp/beta/experimental/packages")
("New Zealand Pre-Releases (nz.xemacs.org)" "ftp.nz.xemacs.org"
"mirror/ftp.xemacs.org/packages")
("Norway Pre-Releases (no.xemacs.org)" "ftp.no.xemacs.org"
+2006-12-09 Vin Shelton <acs@xemacs.org>
+
+ * XEmacs 21.4.20 is released
+
+2006-06-22 Jerry James <james@xemacs.org>
+
+ * lwlib-Xlw.c (xlw_scrollbar_callback): Do not dereference
+ instance before checking whether it is NULL.
+ * xlwmenu.c (xlw_map_menu): Prevent uninitialized access to root
+ and waste.
+
2006-01-28 Vin Shelton <acs@xemacs.org>
* XEmacs 21.4.19 is released
XlwScrollBarCallbackStruct *data =
(XlwScrollBarCallbackStruct *) call_data;
scroll_event event_data;
- scrollbar_values *val =
- (scrollbar_values *) instance->info->val->scrollbar_data;
+ scrollbar_values *val;
double percent;
if (!instance || widget->core.being_destroyed)
return;
+ val = (scrollbar_values *) instance->info->val->scrollbar_data;
id = instance->info->id;
percent = (double) (data->value - 1) / (double) (INT_MAX - 1);
if (!mw->menu.pointer_grabbed)
{
XWindowAttributes ret;
- Window parent,root;
- Window *waste;
+ Window parent,root = 0UL;
+ Window *waste = NULL;
unsigned int num_waste;
lw_menu_active = True;
+2006-12-09 Vin Shelton <acs@xemacs.org>
+
+ * XEmacs 21.4.20 is released
+
+2006-11-07 Robert Pluim <rpluim@gmail.com>
+
+ * lispref/os.texi (User Identification): The code uses HOMEPATH,
+ not HOMEDIR.
+
+2006-07-19 Stephen J. Turnbull <stephen@xemacs.org>
+
+ * new-users-guide/edit.texi (Insert): Document bogosity in
+ vendor labeling of DEL key.
+ (Numeric Argument): Remove spurious RETs from keystroke examples.
+ Thanks to Michael C. Wescott <wescott@sc.rr.com>.
+
+2006-05-17 Stephen J. Turnbull <stephen@xemacs.org>
+
+ * xemacs-faq.texi (Q2.2.3): New node.
+ (Q2.2.2, Q2.3.1): Fix navigation references.
+ (Top, Installation): Add to menus.
+
2006-01-28 Vin Shelton <acs@xemacs.org>
* XEmacs 21.4.19 is released
Return the value of ``@code{(getenv "HOME")}'', if set.
@item
-If the environment variables @code{HOMEDRIVE} and @code{HOMEDIR} are
+If the environment variables @code{HOMEDRIVE} and @code{HOMEPATH} are
both set, return the concatenation (the following description uses MS
Windows environment variable substitution syntax):
-@code{%HOMEDRIVE%%HOMEDIR%}.
+@code{%HOMEDRIVE%%HOMEPATH%}.
@item
Return ``C:\'', as a fallback, but issue a warning.
Therefore, if you type a printing character and then type @key{DEL},
they cancel out.
+ Unfortunately, computer and keyboard manufacturers differ over the
+name of the @key{DEL} key. This is the key at the far right of the row
+of keys containing the digits, usually immediately above the @kbd{RET}
+key. It is usually labelled ``Backspace'' or ``Delete'' or some
+abbreviation. Modern keyboards will often have another key labelled
+``Del'' in the @emph{edit keypad} (along with an ``Ins'' key and perhaps
+some others). This is not the @kbd{DEL} key referred to here. It
+usually deletes @emph{forward} in Emacs.
+
@kindex RET
@cindex newline
@findex auto-fill-mode
- To end a line and start typing a new one, type @key{RET}. This
+ To end a line and start typing a new one, type @key{RET}. On some
+keyboards, this key is labelled ``Enter''. This
inserts a newline character in the buffer. If point is in the middle of
a line, @key{RET} splits the line. Typing @key{DEL} when the cursor is
at the beginning of a line rubs out the newline before the line, thus
a command to move or act backwards. For example, if you want to move
down ten lines, type the following:
@example
-C-u 10 C-n RET
+C-u 10 C-n
@end example
@noindent
-After you press @key{RET} key, the cursor will move ten lines
+After you press the @kbd{C-n} key, the cursor will move ten lines
downward. You can also type:
@example
-M-10 C-n RET
+M-10 C-n
@end example
@noindent
Both @kbd{C-u} and @kbd{M-} allow you to give numeric arguments. If you
want to move ten lines backward, you can also give negative arguments, like:
@example
-C-u -10 C-n RET
+C-u -10 C-n
@end example
@noindent
OR you could also type:
@example
-M--10 C-n RET
+M--10 C-n
@end example
@noindent
You can obviously use @kbd{C-b} to move backward rather than giving
2.2: Unix/Mac OS X Installation (Also Relevant to Cygwin, MinGW)
* Q2.2.1:: Libraries in non-standard locations
* Q2.2.2:: Why can't I strip XEmacs?
+* Q2.2.3:: X11/bitmaps/gray (or other X11-related file) not found.
2.3: Windows Installation (Windows, Cygwin, MinGW)
* Q2.3.1:: What exactly are all the different ways to build XEmacs under Windows?
2.2: Unix/Mac OS X Installation (Also Relevant to Cygwin, MinGW)
* Q2.2.1:: Libraries in non-standard locations
* Q2.2.2:: Why can't I strip XEmacs?
+* Q2.2.3:: X11/bitmaps/gray (or other X11-related file) not found.
2.3: Windows Installation (Windows, Cygwin, MinGW)
* Q2.3.1:: What exactly are all the different ways to build XEmacs under Windows?
--with-site-prefixes=WHATEVER
@end example
-@node Q2.2.2, Q2.3.1, Q2.2.1, Installation
+@node Q2.2.2, Q2.2.3, Q2.2.1, Installation
@unnumberedsubsec Q2.2.2: Why can't I strip XEmacs?
@email{cognot@@fronsac.ensg.u-nancy.fr, Richard Cognot} writes:
@end enumerate
@end quotation
+@node Q2.2.3, Q2.3.1, Q2.2.2, Installation
+@unnumberedsubsec Q2.2.3: X11/bitmaps/gray (or other X11-related file) not found.
+
+The X11R6 distribution was monolithic, but the X11R7 distribution is
+much more modular. Many OS distributions omit these bitmaps (assuming
+nobody uses them, evidently). Your OS distribution should have a
+developer's package containing these files, probably with a name
+containing the string "bitmap". Known package names (you may need to
+add an extension such as .deb or .rpm) include x11/xbitmaps (Ubuntu)
+and xorg-x11-xbitmaps (Fedora Core 5).
+
@unnumberedsec 2.3: Windows Installation (Windows, Cygwin, MinGW)
-@node Q2.3.1, Q2.3.2, Q2.2.2, Installation
+@node Q2.3.1, Q2.3.2, Q2.2.3, Installation
@unnumberedsubsec Q2.3.1: What exactly are all the different ways to build XEmacs under Windows?
XEmacs can be built in several ways in the MS Windows environment.
+2006-12-09 Vin Shelton <acs@xemacs.org>
+
+ * XEmacs 21.4.20 is released
+
+2006-03-04 Vin Shelton <acs@xemacs.org>
+
+ * config.inc.samp: Comment out PACKAGE_PREFIX.
+ * xemacs.mak: Do not set a value for PACKAGE_PATH unless
+ PACKAGE_PATH or PACKAGE_PREFIX was specified in config.inc.
+
+2006-01-28 Vin Shelton <acs@xemacs.org>
+
+ * XEmacs.iss: Erase old code.
+
2006-01-28 Vin Shelton <acs@xemacs.org>
* XEmacs 21.4.19 is released
!if !defined(HAVE_MULE)
HAVE_MULE=0
!endif
+
+# If PACKAGE_PATH was defined, use it. If PACKAGE_PATH was not defined,
+# but PACKAGE_PREFIX was, use PACKAGE_PREFIX to generate a package path.
+# If neither PACKAGE_PATH nor PACKAGE_PREFIX was defined,
+# do not define a package path.
!if !defined(PACKAGE_PATH)
-! if !defined(PACKAGE_PREFIX)
-PACKAGE_PREFIX=c:\Program Files\XEmacs
-! endif
-! if $(HAVE_MULE)
+! if defined(PACKAGE_PREFIX)
+! if $(HAVE_MULE)
PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\mule-packages;$(PACKAGE_PREFIX)\xemacs-packages
-! else
+! else
PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\xemacs-packages
+! endif
! endif
!endif
+!if defined(PACKAGE_PATH)
PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)"
+!endif
+
!if !defined(HAVE_MS_WINDOWS)
HAVE_MS_WINDOWS=1
!endif
!endif
!if [echo LISPDIR>>$(CONFIG_VALUES) && echo "$(MAKEDIR:\=\\)\\$(LISP:\=\\)">>$(CONFIG_VALUES)]
!endif
+!if defined(PATH_PACKAGEPATH)
# PATH_PACKAGEPATH is already a quoted string.
-!if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)]
+! if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)]
+! endif
!endif
# Inferred rule
$(EMACS_BETA_VERSION) \
$(EMACS_PATCH_LEVEL) \
-DXEMACS_CODENAME=\"$(xemacs_codename:&=and)\" \
- -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \
- -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\"
+!if defined(PATH_PACKAGEPATH)
+ -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\" \
+!endif
+ -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\"
!if $(HAVE_X_WINDOWS)
TEMACS_X_OBJS=\
$(DOC): $(LIB_SRC)\make-docfile.exe $(DOC_SRC1) $(DOC_SRC2) $(DOC_SRC3) $(DOC_SRC4) $(DOC_SRC5) $(DOC_SRC6) $(DOC_SRC7) $(DOC_SRC8) $(DOC_SRC9) $(DOC_SRC10) $(DOC_SRC11)
if exist $(DOC) del $(DOC)
+!if defined(PACKAGE_PATH)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+!else
+ set EMACSBOOTSTRAPLOADPATH=$(LISP)
+!endif
set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
$(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC1)
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC11)
update-elc:
+!if defined(PACKAGE_PATH)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+!else
+ set EMACSBOOTSTRAPLOADPATH=$(LISP)
+!endif
set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
$(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\update-elc.el
$(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP
@echo >$(TEMACS_DIR)\SATISFIED
cd $(TEMACS_DIR)
+!if defined(PACKAGE_PATH)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+!else
+ set EMACSBOOTSTRAPLOADPATH=$(LISP)
+!endif
set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
$(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\loadup.el dump
!if $(USE_PORTABLE_DUMPER)
@xcopy /e /q $(XEMACS)\etc "$(INSTALL_DIR)\etc\"
@xcopy /e /q $(XEMACS)\info "$(INSTALL_DIR)\info\"
@xcopy /e /q $(XEMACS)\lisp "$(INSTALL_DIR)\lisp\"
+!if defined(PACKAGE_PREFIX)
@echo Making skeleton package tree in $(PACKAGE_PREFIX) ...
@xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\site-packages\"
$(DEL) "$(PACKAGE_PREFIX)\site-packages\PlaceHolder"
$(DEL) "$(PACKAGE_PREFIX)\mule-packages\PlaceHolder"
@xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\xemacs-packages\"
$(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder"
+!endif
$(DEL) PlaceHolder
mostlyclean:
Using compiler "$(CC) $(CFLAGS)".
!endif
Installing XEmacs in "$(INSTALL_DIR:\=\\)".
+!if defined(PATH_PACKAGEPATH)
Package path is $(PATH_PACKAGEPATH).
+!endif
!if $(INFODOCK)
Building InfoDock.
!endif
result == XtGeometryAlmost ? "XtGeometryAlmost" :
"XtGeometryDone");
if (reply->request_mode & CWWidth)
- printf ("width returned;");
+ printf ("width returned was %d%s",
+ reply->width,
+ reply->request_mode & CWHeight ? "; " : ".\n");
if (reply->request_mode & CWHeight)
- printf ("height returned;");
- printf ("\n");
- printf (" resulting shell size: %d %d\n", reply->width, reply->height);
+ printf ("height returned was %d.\n", reply->height);
+ /* #### does this also need to depend on the result?
+ With XtGeometryYes there doesn't seem to be a useful reply object. */
+ printf (" resulting shell size: %d %d\n",
+ reply->request_mode & CWWidth ? reply->width : w->core.width,
+ reply->request_mode & CWHeight ? reply->height : w->core.height);
printf ("----------\n");
fflush (stdout);
#endif
for (i = 0; i < w->composite.num_children; i++) {
if (XtIsManaged(w->composite.children[i])) {
child = w->composite.children[i];
+ update_size_hints_internal (w, child->core.width,
+ child->core.height);
break;
}
}
-
- update_size_hints_internal (w, child->core.width, child->core.height);
}
/* call the real ChangeManaged */
int from;
int to;
};
- struct jump * const jumps = alloca_array (struct jump, comfy_size);
+ struct jump * const jumps = xnew_array (struct jump, comfy_size);
struct jump *jumps_ptr = jumps;
Opbyte *program_ptr = program;
/* *program_ptr++ = 0; */
*program_length = program_ptr - program;
+ xfree(jumps);
}
/* Optimize the byte code and store the optimized program, only
Xlib might just decide to exit(). So we mark the offending
console for deletion and throw to top level. */
if (d)
- enqueue_magic_eval_event (io_error_delete_device, dev);
- DEVICE_X_BEING_DELETED (d) = 1;
+ {
+ enqueue_magic_eval_event (io_error_delete_device, dev);
+ DEVICE_X_BEING_DELETED (d) = 1;
+ }
Fthrow (Qtop_level, Qnil);
return 0; /* not reached */
******************************************************************************/
int DGifCloseFile(GifFileType *GifFile)
{
- GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+ GifFilePrivateType *Private;
if (GifFile == NULL) return -1;
+ Private = (GifFilePrivateType *)GifFile->Private;
if (!IS_READABLE(Private))
{
/* This file was NOT open for reading: */
Object->Colors = (GifColorType *)calloc(ColorCount, sizeof(GifColorType));
if (Object->Colors == (GifColorType *)NULL)
+ {
+ free (Object);
return((ColorMapObject *)NULL);
+ }
Object->ColorCount = ColorCount;
Object->BitsPerPixel = BitSize(ColorCount);
static Lisp_Object Q_initial_directory;
static Lisp_Object Q_initial_filename;
static Lisp_Object Q_filter_list;
+/* Declared in general-slots.h
static Lisp_Object Q_title;
+*/
static Lisp_Object Q_allow_multi_select;
static Lisp_Object Q_create_prompt_on_nonexistent;
static Lisp_Object Q_overwrite_prompt;
bi.lpfn = handle_directory_proc;
LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil),
- (char*)pd.fname);
+ pd.fname);
{
EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys)
ourselves. */
#ifdef EXTERNAL_WIDGET
/* #### Not sure if this special case is necessary. */
- if (!FRAME_X_EXTERNAL_WINDOW_P (f) && f)
+ if (f && !FRAME_X_EXTERNAL_WINDOW_P (f))
#else
if (f)
#endif
}
else
{
- strcpy(path, getenv("HOME")); strncat(path, "/tmp/", _POSIX_PATH_MAX);
+ path[5 + _POSIX_PATH_MAX] = '\0';
+ strncpy(path, getenv("HOME"), 5 + _POSIX_PATH_MAX);
+ strncat(path, "/tmp/", 5 + _POSIX_PATH_MAX);
if (stat(path, &st) < 0 && errno == ENOENT)
{
int fd;
- char warnpath[1+_POSIX_PATH_MAX];
+ char warnpath[6+_POSIX_PATH_MAX];
mkdir(path, 0700); /* ignore retvals */
- strcpy(warnpath, path);
- strncat(warnpath, ".created_by_xemacs", _POSIX_PATH_MAX);
+ warnpath[_POSIX_PATH_MAX] = '\0';
+ strncpy(warnpath, path, 5 + _POSIX_PATH_MAX);
+ strncat(warnpath, ".created_by_xemacs", 5 + _POSIX_PATH_MAX);
if ((fd = open(warnpath, O_WRONLY|O_CREAT, 0644)) > 0)
{
write(fd, "XEmacs created this directory because /tmp/<yourname> was unavailable -- \nPlease check !\n", 89);
set_extent_start (e, -1);
set_extent_end (e, -1);
}
+
+ /* But we need to clear all the lists containing extents or
+ havoc will result. */
+ extent_list_delete_all (data->extents);
}
- /* But we need to clear all the lists containing extents or
- havoc will result. */
- extent_list_delete_all (data->extents);
soe_invalidate (object);
}
}
#define WIN32_FILENAMES
#ifdef WIN32_NATIVE
#include "nt.h"
+#include <aclapi.h>
#endif /* WIN32_NATIVE */
+#ifdef CYGWIN
+#include <w32api/aclapi.h>
+#endif
+
+
#define IS_DRIVE(x) isalpha (x)
/* Need to lower-case the drive letter, or else expanded
filenames will sometimes compare inequal, because
#endif /* not WIN32_NATIVE */
}
+
+
/* Return nonzero if file FILENAME exists and can be written. */
static int
check_writable (const char *filename)
{
+#if defined(WIN32_NATIVE) || defined(CYGWIN)
+#ifdef CYGWIN
+ char filename_buffer[PATH_MAX];
+#endif
+ // Since this has to work for a directory, we can't just call 'CreateFile'
+ PSECURITY_DESCRIPTOR pDesc; /* Must be freed with LocalFree */
+ /* these need not be freed, they point into pDesc */
+ PSID psidOwner;
+ PSID psidGroup;
+ PACL pDacl;
+ PACL pSacl;
+ /* end of insides of descriptor */
+ DWORD error;
+ DWORD attributes;
+ HANDLE tokenHandle;
+ GENERIC_MAPPING genericMapping;
+ DWORD accessMask;
+ PRIVILEGE_SET PrivilegeSet;
+ DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET );
+ BOOL fAccessGranted = FALSE;
+ DWORD dwAccessAllowed;
+
+#ifdef CYGWIN
+ cygwin_conv_to_full_win32_path(filename, filename_buffer);
+ filename = filename_buffer;
+#endif
+
+ /* Win32 prototype lacks const. */
+ error = GetNamedSecurityInfo((LPTSTR)filename, SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION,
+ &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc);
+ if (error != ERROR_SUCCESS) { // FAT?
+ attributes = GetFileAttributes(filename);
+ return (attributes & FILE_ATTRIBUTE_DIRECTORY) || (0 == (attributes & FILE_ATTRIBUTE_READONLY));
+ }
+
+ genericMapping.GenericRead = FILE_GENERIC_READ;
+ genericMapping.GenericWrite = FILE_GENERIC_WRITE;
+ genericMapping.GenericExecute = FILE_GENERIC_EXECUTE;
+ genericMapping.GenericAll = FILE_ALL_ACCESS;
+
+ if (!ImpersonateSelf(SecurityDelegation)) {
+ return 0;
+ }
+ if (!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &tokenHandle)) {
+ return 0;
+ }
+
+ accessMask = GENERIC_WRITE;
+ MapGenericMask(&accessMask, &genericMapping);
+
+ if (!AccessCheck(pDesc, tokenHandle, accessMask, &genericMapping,
+ &PrivilegeSet, // receives privileges used in check
+ &dwPrivSetSize, // size of PrivilegeSet buffer
+ &dwAccessAllowed, // receives mask of allowed access rights
+ &fAccessGranted))
+ {
+ DWORD oops = GetLastError();
+ CloseHandle(tokenHandle);
+ RevertToSelf();
+ LocalFree(pDesc);
+ return 0;
+ }
+ CloseHandle(tokenHandle);
+ RevertToSelf();
+ LocalFree(pDesc);
+ return fAccessGranted == TRUE;
+#else
#ifdef HAVE_EACCESS
return (eaccess (filename, W_OK) >= 0);
#else
but would lose for directories. */
return (access (filename, W_OK) >= 0);
#endif
+#endif
}
DEFUN ("file-exists-p", Ffile_exists_p, 1, 1, 0, /*
/* shared data for the image read/parse logic */
static short hexTable[256]; /* conversion value */
-static int initialized = FALSE; /* easier to fill in at run time */
+static int hex_initialized = FALSE; /* easier to fill in at run time */
/*
* Table index for the hex values. Initialized once, first time.
hexTable['}'] = -1; hexTable['\n'] = -1;
hexTable['\t'] = -1;
- initialized = TRUE;
+ hex_initialized = TRUE;
}
/*
#define Xmalloc(size) malloc(size)
/* first time initialization */
- if (initialized == FALSE) initHexTable();
+ if (hex_initialized == FALSE) initHexTable();
/* error cleanup and return macro */
#define RETURN(code) { if (data) free (data); return code; }
IMAGE_INSTANCE_WIDGET_FACE (ii),
&w, &h, 0, domain);
/* Adjust the size for borders. */
- if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
+ if (width && IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
*width = w + 2 * widget_instance_border_width (ii);
- if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii))
+ if (height && IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii))
*height = h + 2 * widget_instance_border_width (ii);
}
}
/* Finish off with dynamic sizing. */
- if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)))
+ if (width && !NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)))
{
dynamic_width = Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii));
if (INTP (dynamic_width))
*width = XINT (dynamic_width);
}
- if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)))
+ if (height && !NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)))
{
dynamic_height = Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii));
if (INTP (dynamic_height))
void
XIM_SetGeometry (struct frame *f)
{
- XIC xic = FRAME_X_XIC (f);
- XIMStyle style = FRAME_X_XIC_STYLE (f);
+ XIC xic;
+ XIMStyle style;
XRectangle area;
- if (!xic || !f)
+ if (!f)
+ return;
+
+ xic = FRAME_X_XIC (f);
+ if (!xic)
return;
+ style = FRAME_X_XIC_STYLE (f);
if (style & XIMStatusArea)
{
/* Place Status Area in bottom right corner */
struct key_data *new = xnew_array (struct key_data, size);
memcpy ((void *)new, (const void *)c->keys_so_far,
c->keys_so_far_total_size * sizeof (struct key_data));
+ xfree (c->keys_so_far);
+ c->keys_so_far = new;
}
else
XREALLOC_ARRAY (c->keys_so_far, struct key_data, size);
Bufbyte tempbuf[1024]; /* some random amount */
Lstream_data_count size_in_bytes =
Lstream_read (XLSTREAM (instream), tempbuf, sizeof (tempbuf));
- if (!size_in_bytes)
+ if (size_in_bytes <= 0)
break;
/* Process the bytes. */
/* Stuff taken from wave.c from NAS. Just like snd files, NAS can't
read wave data from memory, so these functions do that for us. */
-#define Err() { return NULL; }
+#define Err() { free (wi); return NULL; }
#define readFourcc(_f) dread(_f, sizeof(RIFF_FOURCC), 1)
#define cmpID(_x, _y) \
strncmp((char *) (_x), (char *) (_y), sizeof(RIFF_FOURCC))
static void
mswindows_free_scrollbar_instance (struct scrollbar_instance *sb)
{
- DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
if (sb->scrollbar_data)
- xfree (sb->scrollbar_data);
+ {
+ DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
+ xfree (sb->scrollbar_data);
+ }
}
static void
static void
x_free_scrollbar_instance (struct scrollbar_instance *instance)
{
- if (SCROLLBAR_X_NAME (instance))
- xfree (SCROLLBAR_X_NAME (instance));
-
- if (SCROLLBAR_X_WIDGET (instance))
+ if (instance->scrollbar_data)
{
- if (XtIsManaged (SCROLLBAR_X_WIDGET (instance)))
- XtUnmanageChild (SCROLLBAR_X_WIDGET (instance));
+ if (SCROLLBAR_X_NAME (instance))
+ xfree (SCROLLBAR_X_NAME (instance));
- lw_destroy_all_widgets (SCROLLBAR_X_ID (instance));
- }
+ if (SCROLLBAR_X_WIDGET (instance))
+ {
+ if (XtIsManaged (SCROLLBAR_X_WIDGET (instance)))
+ XtUnmanageChild (SCROLLBAR_X_WIDGET (instance));
- if (instance->scrollbar_data)
- xfree (instance->scrollbar_data);
+ lw_destroy_all_widgets (SCROLLBAR_X_ID (instance));
+ }
+
+ xfree (instance->scrollbar_data);
+ }
}
/* A device method. */
static void
init_native_sound (struct device *d)
{
- if (DEVICE_TTY_P (d) || DEVICE_STREAM_P (d) || DEVICE_MSWINDOWS_P(d))
+ if (!(DEVICE_X_P(d) || DEVICE_GTK_P(d)))
DEVICE_ON_CONSOLE_P (d) = 1;
#ifdef HAVE_X_WINDOWS
else
DEVICE_ON_CONSOLE_P (d) = 0;
else
{
- char hn [255];
+ char *hn = alloca_array (char, strlen (h->h_name) + 1);
struct hostent *l;
strcpy (hn, h->h_name);
l = gethostbyname (localname);
+2006-12-09 Vin Shelton <acs@xemacs.org>
+
+ * XEmacs 21.4.20 is released
+
+2006-06-24 Stephen J. Turnbull <stephen@xemacs.org>
+
+ * automated/test-harness.el (Silence-Message): New macro.
+ * automated/mule-tests.el: Use it.
+ * automated/region-tests.el: Use it.
+ * automated/tag-tests.el: Use it.
+
+2006-06-24 Stephen J. Turnbull <stephen@xemacs.org>
+
+ * automated/test-harness.el: Improve handling of unexpected errors.
+
2006-01-28 Vin Shelton <acs@xemacs.org>
* XEmacs 21.4.19 is released
(let ((tags-always-exact t))
;; Search for the tag "mystruct"; this should succeed
- (find-tag "mystruct")
+ (Silence-Message
+ (find-tag "mystruct"))
(Assert (eq (point) 2))
;; Search again. The search should fail, based on the patch that
;; Sven Grundmann submitted for 21.4.16.
(Check-Error-Message error "No more entries matching mystruct"
- (tags-loop-continue)))
+ (Silence-Message
+ (tags-loop-continue))))
(let ((tags-always-exact nil))
;; Search for the definition of "require". Until the etags.el upgrade
;; from 21.5 in 21.4.16, this test would fail.
(condition-case nil
- (find-tag "require")
+ (Silence-Message
+ (find-tag "require"))
(t t))
(Assert (eq (point) 52)))
;;; Implementation-Incomplete-Expect-Failure wrapper macros to mark them.
;;; A lot of the tests we run push limits; suppress Ebola message with the
;;; Ignore-Ebola wrapper macro.
+;;; Some noisy code will call `message'. Output from `message' can be
+;;; suppressed with the Silence-Message macro. Functions that are known to
+;;; issue messages include `write-region', `find-tag', `tag-loop-continue',
+;;; `insert', and `mark-whole-buffer'. N.B. The Silence-Message macro
+;;; currently does not suppress the newlines printed by `message'.
+;;; Definitely do not use Silence-Message with Check-Message.
+;;; In general it should probably only be used on code that prepares for a
+;;; test, not on tests.
;;;
;;; You run the tests using M-x test-emacs-test-file,
;;; or $(EMACS) -batch -l .../test-harness.el -f batch-test-emacs file ...
(require 'bytecomp)
+(defvar unexpected-test-suite-failures 0
+ "Cumulative number of unexpected failures since test-harness was loaded.
+
+\"Unexpected failures\" are those caught by a generic handler established
+outside of the test context. As such they involve an abort of the test
+suite for the file being tested.
+
+They often occur during preparation of a test or recording of the results.
+For example, an executable used to generate test data might not be present
+on the system, or a system error might occur while reading a data file.")
+
+(defvar unexpected-test-suite-failure-files nil
+ "List of test files causing unexpected failures.")
+
+;; Declared for dynamic scope; _do not_ initialize here.
+(defvar unexpected-test-file-failures)
+
(defvar test-harness-test-compiled nil
"Non-nil means the test code was compiled before execution.")
(setq body (cons (read buffer) body)))
(end-of-file nil)
(error
+ (incf unexpected-test-file-failures)
(princ (format "Unexpected error %S reading forms from buffer\n"
error-info))))
`(lambda ()
(defvar missing-message-failures)
(defvar other-failures)
- (defvar unexpected-test-suite-failure)
(defvar trick-optimizer)
,@(nreverse body))))
(wrong-error-failures 0)
(missing-message-failures 0)
(other-failures 0)
+ (unexpected-test-file-failures 0)
;; #### perhaps this should be a defvar, and output at the very end
;; OTOH, this way AC types can use a null EMACSPACKAGEPATH to find
(skipped-test-reasons (make-hash-table :test 'equal))
(trick-optimizer nil)
- (unexpected-test-suite-failure nil)
(debug-on-error t)
(pass-stream nil))
(with-output-to-temp-buffer "*Test-Log*"
,quoted-body ',expected-error error-info)
(incf wrong-error-failures)))))
-
+ ;; Do not use this with Silence-Message.
(defmacro Check-Message (expected-message-regexp &rest body)
(Skip-Test-Unless (fboundp 'defadvice)
"can't defadvice"
(incf other-failures)))
(ad-unadvise 'message)))))
+ ;; #### Perhaps this should override `message' itself, too?
+ (defmacro Silence-Message (&rest body)
+ `(flet ((append-message (&rest args) ())) ,@body))
+
(defmacro Ignore-Ebola (&rest body)
`(let ((debug-issue-ebola-notices -42)) ,@body))
(condition-case error-info
(funcall (test-harness-read-from-buffer inbuffer))
(error
- (setq unexpected-test-suite-failure t)
+ (incf unexpected-test-file-failures)
(princ (format "Unexpected error %S while executing interpreted code\n"
error-info))
(message "Unexpected error %S while executing interpreted code." error-info)
(condition-case error-info
(if code (funcall code))
(error
+ (incf unexpected-test-file-failures)
(princ (format "Unexpected error %S while executing byte-compiled code\n"
error-info))
(message "Unexpected error %S while executing byte-compiled code." error-info)
(cons (list filename passes total)
test-harness-file-results-alist))
(message "%s" summary-msg))
- (when unexpected-test-suite-failure
+ (when (> unexpected-test-file-failures 0)
+ (setq unexpected-test-suite-failure-files
+ (cons filename unexpected-test-suite-failure-files))
+ (setq unexpected-test-suite-failures
+ (+ unexpected-test-suite-failures unexpected-test-file-failures))
(message "Test suite execution failed unexpectedly."))
(fmakunbound 'Assert)
(fmakunbound 'Check-Error)
(/ (* 100 nsucc) ntest))
(message test-harness-null-summary-template
(concat basename ":")))
- (setq results (cdr results))))))
+ (setq results (cdr results)))))
+ (when (> unexpected-test-suite-failures 0)
+ (message "\n***** There %s %d unexpected test suite %s in %s:"
+ (if (= unexpected-test-suite-failures 1) "was" "were")
+ unexpected-test-suite-failures
+ (if (= unexpected-test-suite-failures 1) "failure" "failures")
+ (if (= (length unexpected-test-suite-failure-files) 1)
+ "file"
+ "files"))
+ (while unexpected-test-suite-failure-files
+ (let ((line (pop unexpected-test-suite-failure-files)))
+ (while (and (< (length line) 61)
+ unexpected-test-suite-failure-files)
+ (setq line
+ (concat line " "
+ (pop unexpected-test-suite-failure-files))))
+ (message line)))))
(message "\nDone")
(kill-emacs (if error 1 0))))
emacs_is_beta=
emacs_major_version=21
emacs_minor_version=4
-emacs_beta_version=19
-xemacs_codename="Constant Variable"
+emacs_beta_version=20
+xemacs_codename="Double Solitaire"
emacs_kit_version=
infodock_major_version=4
infodock_minor_version=0