From 555b61bb451c0a37c650f702a57b7b5d29b66952 Mon Sep 17 00:00:00 2001
From: Luke Dashjr <luke-jr+git@utopios.org>
Date: Thu, 3 Nov 2011 20:08:42 -0400
Subject: [PATCH 1/3] indentation normalization

---
 README.fileio      |    2 +-
 extension-fileio.c | 2198 +++++++++++++++++++++++++++-------------------------
 extension-fileio.h |    2 +-
 functions.c        |    2 +-
 keywords.c         |  254 ++++---
 5 files changed, 1281 insertions(+), 1177 deletions(-)

diff --git a/README.fileio b/README.fileio
index a694905..fe57ec1 100644
--- a/README.fileio
+++ b/README.fileio
@@ -5,7 +5,7 @@ FileIO is a patch to the LambdaMOO server to allow stdio-style access to
 files.  Please see the file fileio-docs.txt for complete information.
 
 The current version of FileIO, along with documentation in HTML format,
-is on-line at 
+is on-line at
 
   http://www.scinc.com/~abakun/fileio/
 
diff --git a/extension-fileio.c b/extension-fileio.c
index e666793..269ec2e 100644
--- a/extension-fileio.c
+++ b/extension-fileio.c
@@ -44,28 +44,32 @@ typedef unsigned short umode_t;
  * Utility functions
  *****************************************************/
 
-const char *raw_bytes_to_clean(const char *buffer, int buflen) {
-  static Stream *s = 0;
-  int i;
-
-  if(!s) 
-	 s = new_stream(100);
-
-  for (i = 0; i < buflen; i++) {
-	 unsigned char c = buffer[i];
-	 
-	 if (isgraph(c) || c == ' ')
-		stream_add_char(s, c);
-	 /* else drop it on the floor */
-  }
-  
-  return reset_stream(s);
-}	 
-
-const char *clean_to_raw_bytes(const char *buffer, int *buflen) {
-  *buflen = strlen(buffer);
-  return buffer;
-}	 
+const char *
+raw_bytes_to_clean(const char *buffer, int buflen)
+{
+    static Stream *s = 0;
+    int i;
+
+    if (!s)
+	s = new_stream(100);
+
+    for (i = 0; i < buflen; i++) {
+	unsigned char c = buffer[i];
+
+	if (isgraph(c) || c == ' ')
+	    stream_add_char(s, c);
+	/* else drop it on the floor */
+    }
+
+    return reset_stream(s);
+}
+
+const char *
+clean_to_raw_bytes(const char *buffer, int *buflen)
+{
+    *buflen = strlen(buffer);
+    return buffer;
+}
 
 
 /******************************************************
@@ -78,11 +82,11 @@ const char *clean_to_raw_bytes(const char *buffer, int *buflen) {
 
 typedef struct file_type *file_type;
 
-struct file_type { 
-    
-  const char* (*in_filter)(const char *data, int buflen);
+struct file_type {
 
-  const char* (*out_filter)(const char *data, int *buflen);
+    const char* (*in_filter)(const char *data, int buflen);
+
+    const char* (*out_filter)(const char *data, int *buflen);
 
 };
 
@@ -100,19 +104,19 @@ typedef unsigned char file_mode;
 typedef struct file_handle file_handle;
 
 struct file_handle {
-  char  valid;               /* Is this a valid entry?   */
-  char *name;                /* pathname of the file     */
-  file_type type;            /* text or binary, sir?     */
-  file_mode mode;            /* readin', writin' or both */
- 
-  FILE  *file;               /* the actual file handle   */  
+    char  valid;               /* Is this a valid entry?   */
+    char *name;                /* pathname of the file     */
+    file_type type;            /* text or binary, sir?     */
+    file_mode mode;            /* readin', writin' or both */
+
+    FILE  *file;               /* the actual file handle   */
 };
 
 typedef struct line_buffer line_buffer;
 
 struct line_buffer {
-  char *line;
-  struct line_buffer *next;
+    char *line;
+    struct line_buffer *next;
 };
 
 /***************************************************************
@@ -130,90 +134,108 @@ char file_package_version[] = "1.5p3";
 
 file_handle file_table[FILE_IO_MAX_FILES];
 
-char file_handle_valid(Var fhandle) {
-  int32 i = fhandle.v.num;
-  if(fhandle.type != TYPE_INT)
-	 return 0;
-  if((i < 0) || (i >= FILE_IO_MAX_FILES))
-	 return 0;
-  return file_table[i].valid;
+char
+file_handle_valid(Var fhandle)
+{
+    int32 i = fhandle.v.num;
+    if (fhandle.type != TYPE_INT)
+	return 0;
+    if ((i < 0) || (i >= FILE_IO_MAX_FILES))
+	return 0;
+    return file_table[i].valid;
 }
 
 
-FILE *file_handle_file(Var fhandle) {
-  int32 i = fhandle.v.num;
-  return file_table[i].file;
+FILE *
+file_handle_file(Var fhandle)
+{
+    int32 i = fhandle.v.num;
+    return file_table[i].file;
 }
 
-const char *file_handle_name(Var fhandle) {
-  int32 i = fhandle.v.num;
-  return file_table[i].name;
+const char *
+file_handle_name(Var fhandle)
+{
+    int32 i = fhandle.v.num;
+    return file_table[i].name;
 }
 
-file_type file_handle_type(Var fhandle) {
-  int32 i = fhandle.v.num;
-  return file_table[i].type;
-}  
+file_type
+file_handle_type(Var fhandle)
+{
+    int32 i = fhandle.v.num;
+    return file_table[i].type;
+}
 
-file_mode file_handle_mode(Var fhandle) {
-  int32 i = fhandle.v.num;
-  return file_table[i].mode;
-}  
+file_mode
+file_handle_mode(Var fhandle)
+{
+    int32 i = fhandle.v.num;
+    return file_table[i].mode;
+}
 
 
-void file_handle_destroy(Var fhandle) {
-  int32 i = fhandle.v.num;
-  file_table[i].file = NULL;
-  file_table[i].valid = 0;
-  free_str(file_table[i].name);
+void
+file_handle_destroy(Var fhandle)
+{
+    int32 i = fhandle.v.num;
+    file_table[i].file = NULL;
+    file_table[i].valid = 0;
+    free_str(file_table[i].name);
 }
 
 
-int32 file_allocate_next_handle(void) {
-  static int32 current_handle = 0;
-  int32 wrapped = current_handle;
-
-  if(current_handle > FILE_IO_MAX_FILES)
-	 wrapped = current_handle = 0;
-
-  while(current_handle < FILE_IO_MAX_FILES) {
-	 if(!file_table[current_handle].valid)
-		break;
-
-	 current_handle++;
-	 if(current_handle > FILE_IO_MAX_FILES)
-		current_handle = 0;
-	 if(current_handle == wrapped)
-		current_handle = FILE_IO_MAX_FILES;
-  }
-  if(current_handle == FILE_IO_MAX_FILES) {
-	 current_handle = 0;
-	 return -1;
-  }
-  return current_handle;
+int32
+file_allocate_next_handle(void)
+{
+    static int32 current_handle = 0;
+    int32 wrapped = current_handle;
+
+    if (current_handle > FILE_IO_MAX_FILES)
+	wrapped = current_handle = 0;
+
+    while(current_handle < FILE_IO_MAX_FILES) {
+	if (!file_table[current_handle].valid)
+	    break;
+
+	current_handle++;
+	if (current_handle > FILE_IO_MAX_FILES)
+	    current_handle = 0;
+	if (current_handle == wrapped)
+	    current_handle = FILE_IO_MAX_FILES;
+    }
+    if (current_handle == FILE_IO_MAX_FILES) {
+	current_handle = 0;
+	return -1;
+    }
+    return current_handle;
 }
 
 
-Var file_handle_new(const char *name, file_type type, file_mode mode) {
-  Var r;
-  int32 handle = file_allocate_next_handle();
-  
-  r.type = TYPE_INT;
-  r.v.num = handle;
+Var
+file_handle_new(const char *name, file_type type, file_mode mode)
+{
+    Var r;
+    int32 handle = file_allocate_next_handle();
+
+    r.type = TYPE_INT;
+    r.v.num = handle;
 
-  if(handle >= 0) {
-	 file_table[handle].valid = 1;
-	 file_table[handle].name = str_dup(name);
-	 file_table[handle].type = type;
-	 file_table[handle].mode = mode;
-  }
+    if (handle >= 0) {
+	file_table[handle].valid = 1;
+	file_table[handle].name = str_dup(name);
+	file_table[handle].type = type;
+	file_table[handle].mode = mode;
+    }
 
-  return r;
+    return r;
 }
 
-void file_handle_set_file(Var fhandle, FILE *f) {
-  int32 i = fhandle.v.num;
-  file_table[i].file = f;
+void
+file_handle_set_file(Var fhandle, FILE *f)
+{
+    int32 i = fhandle.v.num;
+    file_table[i].file = f;
 }
 
 /***************************************************************
@@ -221,173 +243,196 @@ void file_handle_set_file(Var fhandle, FILE *f) {
  ***************************************************************/
 
 /*
- *  Convert modestring to settings for type and mode.  
+ *  Convert modestring to settings for type and mode.
  *  Returns pointer to stdio modestring if successfull and
  *  NULL if not.
- */ 
-
-const char *file_modestr_to_mode(const char *s, file_type *type, file_mode *mode) {
-  static char buffer[4] = {0, 0, 0, 0};
-  int p = 0;
-  file_type t;
-  file_mode m = 0;
-
-  if(!file_type_binary) {
-	 file_type_binary = mymalloc(sizeof(struct file_type), M_STRING);
-	 file_type_text = mymalloc(sizeof(struct file_type), M_STRING);
-	 file_type_binary->in_filter = raw_bytes_to_binary;
-	 file_type_binary->out_filter = binary_to_raw_bytes;
-	 file_type_text->in_filter = raw_bytes_to_clean;
-	 file_type_text->out_filter = clean_to_raw_bytes;
-  }
-
-  
-  if(strlen(s) != 4)
-	 return 0;
-  
-  if(s[0] == 'r')           m |= FILE_O_READ;
-  else if(s[0] == 'w')      m |= FILE_O_WRITE;
-  else if(s[0] == 'a')      m |= FILE_O_WRITE;
-  else 
-	 return NULL;
-  
-  
-  buffer[p++] = s[0];
-  
-  if(s[1] == '+') {
-	 m |= (s[0] == 'r') ? FILE_O_WRITE : FILE_O_READ;
-	 buffer[p++] = '+';
-  } else if (s[1] != '-') {
-	 return NULL;
-  }
-
-  if(s[2] == 't')            t = file_type_text;
-  else if (s[2] == 'b') {
-	 t = file_type_binary;
-	 buffer[p++] = 'b';
-  } else
-	 return NULL;
-
-  if(s[3] == 'f')            m |= FILE_O_FLUSH;
-  else if (s[3] != 'n')
-	 return NULL;
-
-  *type = t;    *mode = m;
-  buffer[p] = 0;
-  return buffer;
+ */
+
+const char *
+file_modestr_to_mode(const char *s, file_type *type, file_mode *mode)
+{
+    static char buffer[4] = {0, 0, 0, 0};
+    int p = 0;
+    file_type t;
+    file_mode m = 0;
+
+    if (!file_type_binary) {
+	file_type_binary = mymalloc(sizeof(struct file_type), M_STRING);
+	file_type_text = mymalloc(sizeof(struct file_type), M_STRING);
+	file_type_binary->in_filter = raw_bytes_to_binary;
+	file_type_binary->out_filter = binary_to_raw_bytes;
+	file_type_text->in_filter = raw_bytes_to_clean;
+	file_type_text->out_filter = clean_to_raw_bytes;
+    }
+
+    if (strlen(s) != 4)
+	return 0;
+
+    if (s[0] == 'r')
+	m |= FILE_O_READ;
+    else if (s[0] == 'w')
+	m |= FILE_O_WRITE;
+    else if (s[0] == 'a')
+	m |= FILE_O_WRITE;
+    else
+	return NULL;
+
+    buffer[p++] = s[0];
+
+    if (s[1] == '+') {
+	m |= (s[0] == 'r') ? FILE_O_WRITE : FILE_O_READ;
+	buffer[p++] = '+';
+    } else if (s[1] != '-') {
+	return NULL;
+    }
+
+    if (s[2] == 't')
+	t = file_type_text;
+    else if (s[2] == 'b') {
+	t = file_type_binary;
+	buffer[p++] = 'b';
+    } else
+	return NULL;
+
+    if (s[3] == 'f')
+	m |= FILE_O_FLUSH;
+    else if (s[3] != 'n')
+	return NULL;
+
+    *type = t;
+    *mode = m;
+    buffer[p] = 0;
+    return buffer;
 }
-  
+
 
 /***************************************************************
  * Various error handlers
  ***************************************************************/
 
-package 
-file_make_error(const char *errtype, const char *msg) {
-  package p;
-  Var value;
+package
+file_make_error(const char *errtype, const char *msg)
+{
+    package p;
+    Var value;
 
-  value.type = TYPE_STR;
-  value.v.str = str_dup(errtype);
+    value.type = TYPE_STR;
+    value.v.str = str_dup(errtype);
 
-  p.kind = BI_RAISE;
-  p.u.raise.code.type = TYPE_ERR;
-  p.u.raise.code.v.err = E_FILE;
-  p.u.raise.msg = str_dup(msg);
-  p.u.raise.value = value;
+    p.kind = BI_RAISE;
+    p.u.raise.code.type = TYPE_ERR;
+    p.u.raise.code.v.err = E_FILE;
+    p.u.raise.msg = str_dup(msg);
+    p.u.raise.value = value;
 
-  return p;
+    return p;
 }
 
-package file_raise_errno(const char *value_str) {
-  char *strerr;
-  
-  if(errno) {
-	 strerr = strerror(errno);
-	 return file_make_error(value_str, strerr);
-  }  else {
-	 return file_make_error("End of file", "End of file");
-  }
+package
+file_raise_errno(const char *value_str)
+{
+    char *strerr;
+
+    if (errno) {
+	strerr = strerror(errno);
+	return file_make_error(value_str, strerr);
+    } else {
+	return file_make_error("End of file", "End of file");
+    }
 
 }
 
-package file_raise_notokcall(const char *funcid, Objid progr) {
-  return make_error_pack(E_PERM);
+package
+file_raise_notokcall(const char *funcid, Objid progr)
+{
+    return make_error_pack(E_PERM);
 }
 
-package file_raise_notokfilename(const char *funcid, const char *pathname) {
-  Var p;   
+package
+file_raise_notokfilename(const char *funcid, const char *pathname)
+{
+    Var p;
 
-  p.type = TYPE_STR;
-  p.v.str = str_dup(pathname);
-  return make_raise_pack(E_INVARG, "Invalid pathname", p);
+    p.type = TYPE_STR;
+    p.v.str = str_dup(pathname);
+    return make_raise_pack(E_INVARG, "Invalid pathname", p);
 }
 
 /***************************************************************
  * Security verification
  ***************************************************************/
 
-int file_verify_caller(Objid progr) {
-  return is_wizard(progr);
+int
+file_verify_caller(Objid progr)
+{
+    return is_wizard(progr);
 }
 
-int file_verify_path(const char *pathname) {
-  /*
-	*  A pathname is OK does not contain a
-   *  any of instances the substring "/."
-   */
+int
+file_verify_path(const char *pathname)
+{
+    /*
+     *  A pathname is OK does not contain a
+     *  any of instances the substring "/."
+     */
 
-  if(pathname[0] == '\0')
-	 return 1;
+    if (pathname[0] == '\0')
+	return 1;
 
-  if((strlen(pathname) > 1) && (pathname[0] == '.') && (pathname[1] == '.'))
-		return 0;
+    if ((strlen(pathname) > 1) && (pathname[0] == '.') && (pathname[1] == '.'))
+	return 0;
 
-  if(strindex(pathname, "/.", 0))
-		return 0;
-  
-  return 1;
+    if (strindex(pathname, "/.", 0))
+	return 0;
+
+    return 1;
 }
 
 /***************************************************************
  * Common code for FHANDLE-using functions
  **************************************************************/
 
-FILE *file_handle_file_safe(Var handle) {
-  if(!file_handle_valid(handle))
-	 return NULL;
-  else
-	 return file_handle_file(handle);
+FILE *
+file_handle_file_safe(Var handle)
+{
+    if (!file_handle_valid(handle))
+	return NULL;
+    else
+	return file_handle_file(handle);
 }
 
-const char *file_handle_name_safe(Var handle) {
-  if(!file_handle_valid(handle))
-	 return NULL;
-  else
-	 return file_handle_name(handle);
+const char *
+file_handle_name_safe(Var handle)
+{
+    if (!file_handle_valid(handle))
+	return NULL;
+    else
+	return file_handle_name(handle);
 }
 
 /***************************************************************
  * Common code for file opening functions
  ***************************************************************/
 
-const char *file_resolve_path(const char *pathname) {
-  static Stream *s = 0;
-  
-  if(!s)
-	 s = new_stream(strlen(pathname) + strlen(FILE_SUBDIR) + 1);
-  
-  if(!file_verify_path(pathname))
-	 return NULL;
-  
-  stream_add_string(s, FILE_SUBDIR);
-  if(pathname[0] == '/')
-	 stream_add_string(s, pathname + 1);
-  else
-	 stream_add_string(s, pathname);
-  
-  return reset_stream(s);
-  
+const char *
+file_resolve_path(const char *pathname)
+{
+    static Stream *s = 0;
+
+    if (!s)
+	s = new_stream(strlen(pathname) + strlen(FILE_SUBDIR) + 1);
+
+    if (!file_verify_path(pathname))
+	return NULL;
+
+    stream_add_string(s, FILE_SUBDIR);
+    if (pathname[0] == '/')
+	stream_add_string(s, pathname + 1);
+    else
+	stream_add_string(s, pathname);
+
+    return reset_stream(s);
+
 }
 
 /***************************************************************
@@ -397,19 +442,19 @@ const char *file_resolve_path(const char *pathname) {
 
 static package
 bf_file_version(Var arglist, Byte next, void *vdata, Objid progr)
-{ 
-  char tmpbuffer[50];
-  Var rv;
-  
-  sprintf(tmpbuffer, "%s/%s", file_package_name, file_package_version);
-  
-  rv.type = TYPE_STR;
-  rv.v.str = str_dup(tmpbuffer);
+{
+    char tmpbuffer[50];
+    Var rv;
 
-  return make_var_pack(rv);
+    sprintf(tmpbuffer, "%s/%s", file_package_name, file_package_version);
+
+    rv.type = TYPE_STR;
+    rv.v.str = str_dup(tmpbuffer);
+
+    return make_var_pack(rv);
 
 }
-  
+
 
 /***************************************************************
  * File open and close.
@@ -422,37 +467,38 @@ bf_file_version(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_open(Var arglist, Byte next, void *vdata, Objid progr)
-{ 
-  package r;
-  Var fhandle;
-  const char *real_filename;
-  const char *filename = arglist.v.list[1].v.str;
-  const char *mode = arglist.v.list[2].v.str;
-  const char *fmode;
-  file_mode rmode;
-  file_type type;
-  FILE *f;
-
-  errno = 0;
-
-  if(!file_verify_caller(progr))
-	 r = file_raise_notokcall("file_open", progr);
-  else if ((real_filename = file_resolve_path(filename)) == NULL)
-	 r = file_raise_notokfilename("file_open", filename);
-  else if ((fmode = file_modestr_to_mode(mode, &type, &rmode)) == NULL)
-	 r = make_raise_pack(E_INVARG, "Invalid mode string", var_ref(arglist.v.list[2]));
-  else if ((fhandle = file_handle_new(filename, type, rmode)).v.num < 0)
-	 r = make_raise_pack(E_QUOTA, "Too many files open", zero);
-  else if ((f = fopen(real_filename, fmode)) == NULL) {
-	 file_handle_destroy(fhandle);
-	 r = file_raise_errno("file_open");
-  } else {
-	 /* phew, we actually got a successfull open */
-	 file_handle_set_file(fhandle, f);		  
-	 r = make_var_pack(fhandle);
-  }
-  free_var(arglist);
-  return r;
+{
+    package r;
+    Var fhandle;
+    const char *real_filename;
+    const char *filename = arglist.v.list[1].v.str;
+    const char *mode = arglist.v.list[2].v.str;
+    const char *fmode;
+    file_mode rmode;
+    file_type type;
+    FILE *f;
+
+    errno = 0;
+
+    if (!file_verify_caller(progr))
+	r = file_raise_notokcall("file_open", progr);
+    else if ((real_filename = file_resolve_path(filename)) == NULL)
+	r = file_raise_notokfilename("file_open", filename);
+    else if ((fmode = file_modestr_to_mode(mode, &type, &rmode)) == NULL)
+	r = make_raise_pack(E_INVARG, "Invalid mode string",
+			    var_ref(arglist.v.list[2]));
+    else if ((fhandle = file_handle_new(filename, type, rmode)).v.num < 0)
+	r = make_raise_pack(E_QUOTA, "Too many files open", zero);
+    else if ((f = fopen(real_filename, fmode)) == NULL) {
+	file_handle_destroy(fhandle);
+	r = file_raise_errno("file_open");
+    } else {
+	/* phew, we actually got a successfull open */
+	file_handle_set_file(fhandle, f);
+	r = make_var_pack(fhandle);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -462,23 +508,23 @@ bf_file_open(Var arglist, Byte next, void *vdata, Objid progr)
 static package
 bf_file_close(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];
-  FILE *f;
-
-  errno = 0;
-
-  if(!file_verify_caller(progr))
-	 r = file_raise_notokcall("file_close", progr);
-  else if ((f = file_handle_file_safe(fhandle)) == NULL)
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
-  else {
-	 fclose(f);
-	 file_handle_destroy(fhandle);
-	 r = no_var_pack();
-  }
-  free_var(arglist);
-  return r;
+    package r;
+    Var fhandle = arglist.v.list[1];
+    FILE *f;
+
+    errno = 0;
+
+    if (!file_verify_caller(progr))
+	r = file_raise_notokcall("file_close", progr);
+    else if ((f = file_handle_file_safe(fhandle)) == NULL)
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
+    else {
+	fclose(f);
+	file_handle_destroy(fhandle);
+	r = no_var_pack();
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -488,103 +534,104 @@ bf_file_close(Var arglist, Byte next, void *vdata, Objid progr)
 static package
 bf_file_name(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];
-  const char *name;
-  Var rv;   
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_name", progr);
-  } else if ((name = file_handle_name_safe(fhandle)) == NULL) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
-  } else {
-	 rv.type = TYPE_STR;
-	 rv.v.str = str_dup(name);
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+    package r;
+    Var fhandle = arglist.v.list[1];
+    const char *name;
+    Var rv;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_name", progr);
+    } else if ((name = file_handle_name_safe(fhandle)) == NULL) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
+    } else {
+	rv.type = TYPE_STR;
+	rv.v.str = str_dup(name);
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 static package
 bf_file_openmode(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];
-  char buffer[5] = {0, 0, 0, 0, 0};
-  file_mode mode;
-  file_type type;
-  Var rv;   
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_name", progr);
-  } else if (!file_handle_valid(fhandle)) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
-  } else {
-	 type = file_handle_type(fhandle);
-	 mode = file_handle_mode(fhandle);
-	 if(mode & FILE_O_READ) {
-		buffer[0] = 'r';
-	 } else if(mode & FILE_O_WRITE) {
-		buffer[0] = 'w';
-	 }
-	 if(mode & (FILE_O_READ | FILE_O_WRITE))
-		buffer[1] = '+';
-	 else
-		buffer[1] = '-';
-
-	 if(type == file_type_binary)
-		buffer[2] = 'b';
-	 else
-		buffer[2] = 't';
-	 
-	 if(mode & FILE_O_FLUSH)
-		buffer[3] = 'f';
-	 else
-		buffer[3] = 'n';
-	 
-
-	 rv.type = TYPE_STR;
-	 rv.v.str = str_dup(buffer);
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+    package r;
+    Var fhandle = arglist.v.list[1];
+    char buffer[5] = {0, 0, 0, 0, 0};
+    file_mode mode;
+    file_type type;
+    Var rv;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_name", progr);
+    } else if (!file_handle_valid(fhandle)) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
+    } else {
+	type = file_handle_type(fhandle);
+	mode = file_handle_mode(fhandle);
+	if (mode & FILE_O_READ) {
+	    buffer[0] = 'r';
+	} else if (mode & FILE_O_WRITE) {
+	    buffer[0] = 'w';
+	}
+	if (mode & (FILE_O_READ | FILE_O_WRITE))
+	    buffer[1] = '+';
+	else
+	    buffer[1] = '-';
+
+	if (type == file_type_binary)
+	    buffer[2] = 'b';
+	else
+	    buffer[2] = 't';
+
+	if (mode & FILE_O_FLUSH)
+	    buffer[3] = 'f';
+	else
+	    buffer[3] = 'n';
+
+	rv.type = TYPE_STR;
+	rv.v.str = str_dup(buffer);
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 
 
 /**********************************************************
- * string (line-based) i/o                                
+ * string (line-based) i/o
  **********************************************************/
 
-/* 
- * common functionality of file_readline and file_readlines 
+/*
+ * common functionality of file_readline and file_readlines
  */
 
-static const char *file_read_line(Var fhandle, int *count) {
-  static Stream *str = 0;
-  FILE *f;
-  int c;
-
-  f = file_handle_file(fhandle);
-  
-  if(str == 0)
-	 str = new_stream(FILE_IO_BUFFER_LENGTH);
-  
-  while((c = fgetc(f)) != EOF && c != '\n')
-	 stream_add_char(str, c);
-
-  if(c == EOF && stream_length(str) == 0) {
-	 reset_stream(str);
-	 *count = 0;
-	 return NULL;
-  }
-
-  *count = stream_length(str);
-  return reset_stream(str);
+static const char *
+file_read_line(Var fhandle, int *count)
+{
+    static Stream *str = 0;
+    FILE *f;
+    int c;
+
+    f = file_handle_file(fhandle);
+
+    if (str == 0)
+	str = new_stream(FILE_IO_BUFFER_LENGTH);
+
+    while((c = fgetc(f)) != EOF && c != '\n')
+	stream_add_char(str, c);
+
+    if (c == EOF && stream_length(str) == 0) {
+	reset_stream(str);
+	*count = 0;
+	return NULL;
+    }
+
+    *count = stream_length(str);
+    return reset_stream(str);
 }
-  
+
 
 /*
  * STR file_readline(FHANDLE handle)
@@ -593,143 +640,148 @@ static const char *file_read_line(Var fhandle, int *count) {
 static package
 bf_file_readline(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];
-  Var rv;
-  int len;
-  file_mode mode;
-  file_type type;
-  const char *line;
-
-  errno = 0;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_readline", progr);
-  } else if (!file_handle_valid(fhandle)) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
-  } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_READ)
-	 r = make_raise_pack(E_INVARG, "File is open write-only", fhandle);
-  else {
-	 type = file_handle_type(fhandle);
-	 if((line = file_read_line(fhandle, &len)) == NULL)
-		r = file_raise_errno("readline");
-	 else {		
-		rv.type = TYPE_STR;
-		rv.v.str = str_dup((type->in_filter)(line, len));
-		r = make_var_pack(rv);
-	 }
-  }
-  free_var(arglist);
-  return r;			 
+    package r;
+    Var fhandle = arglist.v.list[1];
+    Var rv;
+    int len;
+    file_mode mode;
+    file_type type;
+    const char *line;
+
+    errno = 0;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_readline", progr);
+    } else if (!file_handle_valid(fhandle)) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
+    } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_READ)
+	r = make_raise_pack(E_INVARG, "File is open write-only", fhandle);
+    else {
+	type = file_handle_type(fhandle);
+	if ((line = file_read_line(fhandle, &len)) == NULL)
+	    r = file_raise_errno("readline");
+	else {
+	    rv.type = TYPE_STR;
+	    rv.v.str = str_dup((type->in_filter)(line, len));
+	    r = make_var_pack(rv);
+	}
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
  * STR file_readlines(FHANDLE handle, INT start, INT end)
  */
 
-void free_line_buffer(line_buffer *head, int strings_too) {
-  line_buffer *next;
-  if(head) {
-	 next = head->next;
-	 myfree(head, M_STRUCT);
-	 head = next;
-	 while(head != NULL) {
-		next = head->next;
-		if(strings_too)
-		  free_str(head->line);
-		myfree(head, M_STRUCT);
-		head = next;
-	 }   
-  }
+void
+free_line_buffer(line_buffer *head, int strings_too)
+{
+    line_buffer *next;
+    if (head) {
+	next = head->next;
+	myfree(head, M_STRUCT);
+	head = next;
+	while(head != NULL) {
+	    next = head->next;
+	    if (strings_too)
+	    free_str(head->line);
+	    myfree(head, M_STRUCT);
+	    head = next;
+	}
+    }
 }
-    
-line_buffer *new_line_buffer(char *line) {
-  line_buffer *p = mymalloc(sizeof(line_buffer), M_STRUCT);
-  p->line = line;
-  p->next = NULL;
-  return p;
+
+line_buffer *
+new_line_buffer(char *line)
+{
+    line_buffer *p = mymalloc(sizeof(line_buffer), M_STRUCT);
+    p->line = line;
+    p->next = NULL;
+    return p;
 }
 
 static package
 bf_file_readlines(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];
-  int32 begin = arglist.v.list[2].v.num;
-  int32 end   = arglist.v.list[3].v.num;
-  int32 begin_loc = 0, linecount = 0;
-  file_type type;
-  file_mode mode;
-  Var rv;
-  int current_line = 0, len = 0, i = 0;
-  const char *line = NULL;
-  FILE *f;
-  line_buffer *linebuf_head = NULL, *linebuf_cur = NULL;
-
-  errno = 0;
-
-  if((begin < 1) || (begin > end))
-	 return make_error_pack(E_INVARG);
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_readlines", progr);
-  } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
-  } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_READ)
-	 r = make_raise_pack(E_INVARG, "File is open write-only", fhandle);
-  else {
-
-	 /* Back to the beginning ... */
-	 rewind(f);
-
-	 /* "seek" to that line */
-	 begin--;
-	 while((current_line != begin) 
-			 && ((line = file_read_line(fhandle, &len)) != NULL)) 
-		current_line++;	
-	 
-	 if(((begin != 0) && (line == NULL)) || ((begin_loc = ftell(f)) == -1))
-		r = file_raise_errno("read_line");
-	 else {
-		type = file_handle_type(fhandle);
-
-		/* 
-		 * now that we have where to begin, it's time to slurp lines 
-		 * and seek to EOF or to the end_line, whichever comes first
-		 */
-		
-		linebuf_head = linebuf_cur = new_line_buffer(NULL);
-		
-		while((current_line != end) 
-				&& ((line = file_read_line(fhandle, &len)) != NULL)) {
-		  linebuf_cur->next = new_line_buffer(str_dup((type->in_filter)(line, len)));
-		  linebuf_cur = linebuf_cur->next;
-		  
-		  current_line++;
-		  }	
-		linecount =  current_line - begin;
-
-		linebuf_cur = linebuf_head->next;
-
-		if(fseek(f, begin_loc, SEEK_SET) == -1) {
-		  free_line_buffer(linebuf_head, 1);
-		  r = file_raise_errno("seeking");
-		} else {
-		  rv = new_list(linecount);		  
-		  i = 1;
-		  while(linebuf_cur != NULL) {
-			 rv.v.list[i].type = TYPE_STR;
-			 rv.v.list[i].v.str = linebuf_cur->line;
-			 linebuf_cur = linebuf_cur->next;
-			 i++;
-		  }
-		  free_line_buffer(linebuf_head, 0);
-		  r = make_var_pack(rv);
+    package r;
+    Var fhandle = arglist.v.list[1];
+    int32 begin = arglist.v.list[2].v.num;
+    int32 end   = arglist.v.list[3].v.num;
+    int32 begin_loc = 0, linecount = 0;
+    file_type type;
+    file_mode mode;
+    Var rv;
+    int current_line = 0, len = 0, i = 0;
+    const char *line = NULL;
+    FILE *f;
+    line_buffer *linebuf_head = NULL, *linebuf_cur = NULL;
+
+    errno = 0;
+
+    if ((begin < 1) || (begin > end))
+	return make_error_pack(E_INVARG);
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_readlines", progr);
+    } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
+    } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_READ)
+	r = make_raise_pack(E_INVARG, "File is open write-only", fhandle);
+    else {
+
+	/* Back to the beginning ... */
+	rewind(f);
+
+	/* "seek" to that line */
+	begin--;
+	while((current_line != begin)
+	      && ((line = file_read_line(fhandle, &len)) != NULL))
+	    current_line++;
+
+	if (((begin != 0) && (line == NULL)) || ((begin_loc = ftell(f)) == -1))
+	    r = file_raise_errno("read_line");
+	else {
+	    type = file_handle_type(fhandle);
+
+	    /*
+	     * now that we have where to begin, it's time to slurp lines
+	     * and seek to EOF or to the end_line, whichever comes first
+	     */
+
+	    linebuf_head = linebuf_cur = new_line_buffer(NULL);
+
+	    while((current_line != end)
+			    && ((line = file_read_line(fhandle, &len)) != NULL)) {
+		linebuf_cur->next = new_line_buffer(
+				    str_dup((type->in_filter)(line, len)));
+		linebuf_cur = linebuf_cur->next;
+
+		current_line++;
+	    }
+	    linecount = current_line - begin;
+
+	    linebuf_cur = linebuf_head->next;
+
+	    if (fseek(f, begin_loc, SEEK_SET) == -1) {
+		free_line_buffer(linebuf_head, 1);
+		r = file_raise_errno("seeking");
+	    } else {
+		rv = new_list(linecount);
+		i = 1;
+		while(linebuf_cur != NULL) {
+		    rv.v.list[i].type = TYPE_STR;
+		    rv.v.list[i].v.str = linebuf_cur->line;
+		    linebuf_cur = linebuf_cur->next;
+		    i++;
 		}
-	 }
-  }
+		free_line_buffer(linebuf_head, 0);
+		r = make_var_pack(rv);
+	    }
+	}
+    }
 
-  free_var(arglist);
-  return r;			 
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -739,38 +791,38 @@ bf_file_readlines(Var arglist, Byte next, void *vdata, Objid progr)
 static package
 bf_file_writeline(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];  
-  const char *buffer = arglist.v.list[2].v.str;
-  const char *rawbuffer;
-  file_mode mode;
-  file_type type;
-  int len;
-  FILE *f;
-
-  errno = 0;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_writeline", progr);
-  } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
-  } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_WRITE)
-	 r = make_raise_pack(E_INVARG, "File is open read-only", fhandle);
-  else {
-	 type = file_handle_type(fhandle);
-	 if((rawbuffer = (type->out_filter)(buffer, &len)) == NULL)
-		r = make_raise_pack(E_INVARG, "Invalid binary string", fhandle);
-	 else if((fputs(rawbuffer, f) == EOF) || (fputc('\n', f) != '\n'))
-		r = file_raise_errno(file_handle_name(fhandle));
-	 else {
-		  if(mode & FILE_O_FLUSH) {
-			 fflush(f);
-		  }
-		r = no_var_pack();
-	 }
-  }
-  free_var(arglist);
-  return r;			 
+    package r;
+    Var fhandle = arglist.v.list[1];
+    const char *buffer = arglist.v.list[2].v.str;
+    const char *rawbuffer;
+    file_mode mode;
+    file_type type;
+    int len;
+    FILE *f;
+
+    errno = 0;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_writeline", progr);
+    } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
+    } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_WRITE)
+	r = make_raise_pack(E_INVARG, "File is open read-only", fhandle);
+    else {
+	type = file_handle_type(fhandle);
+	if ((rawbuffer = (type->out_filter)(buffer, &len)) == NULL)
+	    r = make_raise_pack(E_INVARG, "Invalid binary string", fhandle);
+	else if ((fputs(rawbuffer, f) == EOF) || (fputc('\n', f) != '\n'))
+	    r = file_raise_errno(file_handle_name(fhandle));
+	else {
+	    if (mode & FILE_O_FLUSH) {
+		fflush(f);
+	    }
+	    r = no_var_pack();
+	}
+    }
+    free_var(arglist);
+    return r;
 }
 
 /********************************************************
@@ -784,72 +836,69 @@ bf_file_writeline(Var arglist, Byte next, void *vdata, Objid progr)
 static package
 bf_file_read(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-
-  Var fhandle = arglist.v.list[1];
-  file_mode mode;
-  file_type type;
-  int32 record_length = arglist.v.list[2].v.num;
-  int32 read_length;
-
-  char buffer[FILE_IO_BUFFER_LENGTH];
-
-  Var rv;
-
-  static Stream *str = 0;
-  int len = 0, read = 0;
-
-  FILE *f;
-
-  errno = 0;
-
-  read_length = (record_length > sizeof(buffer)) ? sizeof(buffer) : record_length;
-
-  if(str == 0)
-	 str = new_stream(FILE_IO_BUFFER_LENGTH);
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_read", progr);
-  } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
-  } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_READ)
-	 r = make_raise_pack(E_INVARG, "File is open write-only", fhandle);
-  else {
-	 type = file_handle_type(fhandle);
-
-  try_again:
-	 read = fread(buffer, sizeof(char), read_length, f);
-	 if(!read && !len) {
-		/* 
-		 * No more to read.  This is only an error if nothing
-		 * has been read so far.
-		 *
-		 */
-		r = file_raise_errno(file_handle_name(fhandle));		
-	 } else if (read && ((len += read) < record_length)){
-		/*
-		 * We got something this time, but it isn't enough.
-		 */
-		stream_add_string(str, (type->in_filter)(buffer, read));
-		read = 0;
-		goto try_again;
-	 } else {
-		/*
-		 * We didn't get anything last time, but we have something already
-		 * OR
-		 * We got everything we need.
-		 */
-		
-		stream_add_string(str, (type->in_filter)(buffer, read));
-
-		rv.type = TYPE_STR;
-		rv.v.str = str_dup(reset_stream(str));					 
-
-		r = make_var_pack(rv);
-	 }
-  }
-  free_var(arglist);
-  return r;			 
+    package r;
+
+    Var fhandle = arglist.v.list[1];
+    file_mode mode;
+    file_type type;
+    int32 record_length = arglist.v.list[2].v.num;
+    int32 read_length;
+
+    char buffer[FILE_IO_BUFFER_LENGTH];
+
+    Var rv;
+
+    static Stream *str = 0;
+    int len = 0, read = 0;
+
+    FILE *f;
+
+    errno = 0;
+
+    read_length = (record_length > sizeof(buffer)) ? sizeof(buffer) : record_length;
+
+    if (str == 0)
+	str = new_stream(FILE_IO_BUFFER_LENGTH);
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_read", progr);
+    } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
+    } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_READ)
+	r = make_raise_pack(E_INVARG, "File is open write-only", fhandle);
+    else {
+	type = file_handle_type(fhandle);
+
+try_again:
+	read = fread(buffer, sizeof(char), read_length, f);
+	if (!read && !len) {
+	    /*
+	     * No more to read.  This is only an error if nothing
+	     * has been read so far.
+	     */
+	    r = file_raise_errno(file_handle_name(fhandle));
+	} else if (read && ((len += read) < record_length)){
+	    /* We got something this time, but it isn't enough. */
+	    stream_add_string(str, (type->in_filter)(buffer, read));
+	    read = 0;
+	    goto try_again;
+	} else {
+	    /*
+	     * We didn't get anything last time, but we have something already
+	     * OR
+	     * We got everything we need.
+	     */
+
+	    stream_add_string(str, (type->in_filter)(buffer, read));
+
+	    rv.type = TYPE_STR;
+	    rv.v.str = str_dup(reset_stream(str));
+
+	    r = make_var_pack(rv);
+	}
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -859,24 +908,24 @@ bf_file_read(Var arglist, Byte next, void *vdata, Objid progr)
 static package
 bf_file_flush(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];
-  FILE *f;
-
-  errno = 0;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_flush", progr);
-  } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
-  } else {
-	 if(fflush(f))
-		r = file_raise_errno("flushing");
-	 else
-		r = no_var_pack();
-  }
-  free_var(arglist);
-  return r;
+    package r;
+    Var fhandle = arglist.v.list[1];
+    FILE *f;
+
+    errno = 0;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_flush", progr);
+    } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
+    } else {
+	if (fflush(f))
+	    r = file_raise_errno("flushing");
+	else
+	    r = no_var_pack();
+    }
+    free_var(arglist);
+    return r;
 }
 
 
@@ -887,40 +936,40 @@ bf_file_flush(Var arglist, Byte next, void *vdata, Objid progr)
 static package
 bf_file_write(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1], rv;  
-  const char *buffer = arglist.v.list[2].v.str;
-  const char *rawbuffer;
-  file_mode mode;
-  file_type type;
-  int len;
-  int written;
-  FILE *f;
-
-  errno = 0;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_write", progr);
-  } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
-  } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_WRITE)
-	 r = make_raise_pack(E_INVARG, "File is open read-only", fhandle);
-  else {
-	 type = file_handle_type(fhandle);
-	 if((rawbuffer = (type->out_filter)(buffer, &len)) == NULL)
-		r = make_raise_pack(E_INVARG, "Invalid binary string", fhandle);
-	 else if(!(written = fwrite(rawbuffer, sizeof(char), len, f)))
-		r = file_raise_errno(file_handle_name(fhandle));
-	 else {
-		if(mode & FILE_O_FLUSH)
-		  fflush(f);
-		rv.type = TYPE_INT;
-		rv.v.num = written;
-		r = make_var_pack(rv);
-	 }
-  }
-  free_var(arglist);
-  return r;			 
+    package r;
+    Var fhandle = arglist.v.list[1], rv;
+    const char *buffer = arglist.v.list[2].v.str;
+    const char *rawbuffer;
+    file_mode mode;
+    file_type type;
+    int len;
+    int written;
+    FILE *f;
+
+    errno = 0;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_write", progr);
+    } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", fhandle);
+    } else if (!(mode = file_handle_mode(fhandle)) & FILE_O_WRITE)
+	r = make_raise_pack(E_INVARG, "File is open read-only", fhandle);
+    else {
+	type = file_handle_type(fhandle);
+	if ((rawbuffer = (type->out_filter)(buffer, &len)) == NULL)
+	    r = make_raise_pack(E_INVARG, "Invalid binary string", fhandle);
+	else if (!(written = fwrite(rawbuffer, sizeof(char), len, f)))
+	    r = file_raise_errno(file_handle_name(fhandle));
+	else {
+	    if (mode & FILE_O_FLUSH)
+		fflush(f);
+	    rv.type = TYPE_INT;
+	    rv.v.num = written;
+	    r = make_var_pack(rv);
+	}
+    }
+    free_var(arglist);
+    return r;
 }
 
 
@@ -936,38 +985,38 @@ bf_file_write(Var arglist, Byte next, void *vdata, Objid progr)
 static package
 bf_file_seek(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];
-  int32 seek_to = arglist.v.list[2].v.num;
-  const char *whence = arglist.v.list[3].v.str;
-  int whnce = 0, whence_ok = 1;
-  FILE *f;
-
-  errno = 0;
-
-  if(!mystrcasecmp(whence, "SEEK_SET"))
-	 whnce = SEEK_SET;
-  else if (!mystrcasecmp(whence, "SEEK_CUR"))
-	 whnce = SEEK_CUR;
-  else if (!mystrcasecmp(whence, "SEEK_END"))
-	 whnce = SEEK_END;
-  else 
-	 whence_ok = 0;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_seek", progr);
-  } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", var_ref(fhandle));
-  } else if (!whence_ok) {
-	 r = make_raise_pack(E_INVARG, "Invalid whence", zero);
-  } else {
-	 if(fseek(f, seek_to, whnce))
-		r = file_raise_errno(file_handle_name(fhandle));		
-	 else
-		r = no_var_pack();
-  }
-  free_var(arglist);
-  return r;
+    package r;
+    Var fhandle = arglist.v.list[1];
+    int32 seek_to = arglist.v.list[2].v.num;
+    const char *whence = arglist.v.list[3].v.str;
+    int whnce = 0, whence_ok = 1;
+    FILE *f;
+
+    errno = 0;
+
+    if (!mystrcasecmp(whence, "SEEK_SET"))
+	whnce = SEEK_SET;
+    else if (!mystrcasecmp(whence, "SEEK_CUR"))
+	whnce = SEEK_CUR;
+    else if (!mystrcasecmp(whence, "SEEK_END"))
+	whnce = SEEK_END;
+    else
+	whence_ok = 0;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_seek", progr);
+    } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", var_ref(fhandle));
+    } else if (!whence_ok) {
+	r = make_raise_pack(E_INVARG, "Invalid whence", zero);
+    } else {
+	if (fseek(f, seek_to, whnce))
+	    r = file_raise_errno(file_handle_name(fhandle));
+	else
+	    r = no_var_pack();
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -977,26 +1026,26 @@ bf_file_seek(Var arglist, Byte next, void *vdata, Objid progr)
 static package
 bf_file_tell(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];
-  Var rv;
-  FILE *f;
-
-  errno = 0;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_tell", progr);
-  } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", var_ref(fhandle));
-  } else {
-	 rv.type = TYPE_INT;
-	 if((rv.v.num = ftell(f)) < 0)
-		r = file_raise_errno(file_handle_name(fhandle));		
-	 else
-		r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+    package r;
+    Var fhandle = arglist.v.list[1];
+    Var rv;
+    FILE *f;
+
+    errno = 0;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_tell", progr);
+    } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", var_ref(fhandle));
+    } else {
+	rv.type = TYPE_INT;
+	if ((rv.v.num = ftell(f)) < 0)
+	    r = file_raise_errno(file_handle_name(fhandle));
+	else
+	    r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -1006,24 +1055,24 @@ bf_file_tell(Var arglist, Byte next, void *vdata, Objid progr)
 static package
 bf_file_eof(Var arglist, Byte next, void *vdata, Objid progr)
 {
-  package r;
-  Var fhandle = arglist.v.list[1];
-  Var rv;
-  FILE *f;
-
-  errno = 0;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_eof", progr);
-  } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
-	 r = make_raise_pack(E_INVARG, "Invalid FHANDLE", var_ref(fhandle));
-  } else {
-	 rv.type = TYPE_INT;
-	 rv.v.num = feof(f);	 
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+    package r;
+    Var fhandle = arglist.v.list[1];
+    Var rv;
+    FILE *f;
+
+    errno = 0;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_eof", progr);
+    } else if ((f = file_handle_file_safe(fhandle)) == NULL) {
+	r = make_raise_pack(E_INVARG, "Invalid FHANDLE", var_ref(fhandle));
+    } else {
+	rv.type = TYPE_INT;
+	rv.v.num = feof(f);
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*****************************************************************
@@ -1034,62 +1083,68 @@ bf_file_eof(Var arglist, Byte next, void *vdata, Objid progr)
  * (internal) int(statok) file_stat(Var filespec, package *r, struct stat *buf)
  */
 
-int file_stat(Objid progr, Var filespec, package *r, struct stat *buf) {
-  int statok = 0;
-  
-  if(!file_verify_caller(progr)) {
-	 *r = file_raise_notokcall("file_stat", progr);
-  } else if (filespec.type == TYPE_STR) {
-	 const char *filename = filespec.v.str;
-	 const char *real_filename;
-
-	 if((real_filename = file_resolve_path(filename)) == NULL) {
-		*r =  file_raise_notokfilename("file_stat", filename);
-	 } else {
-		if(stat(real_filename, buf) != 0)		  
-		  *r = file_raise_errno(filename);
-		else {
-		  statok = 1;
-		}
-	 }
-  } else {
-	 FILE *f;
-	 if((f = file_handle_file_safe(filespec)) == NULL)
-		*r = make_raise_pack(E_INVARG, "Invalid FHANDLE", filespec);
-	 else {
-		if(fstat(fileno(f), buf) != 0)
-		  *r = file_raise_errno(file_handle_name(filespec));
-		else {
-		  statok = 1;
-		}
-	 }
-  }
-  return statok;
+int
+file_stat(Objid progr, Var filespec, package *r, struct stat *buf)
+{
+    int statok = 0;
+
+    if (!file_verify_caller(progr)) {
+	*r = file_raise_notokcall("file_stat", progr);
+    } else if (filespec.type == TYPE_STR) {
+	const char *filename = filespec.v.str;
+	const char *real_filename;
+
+	if ((real_filename = file_resolve_path(filename)) == NULL) {
+	    *r =  file_raise_notokfilename("file_stat", filename);
+	} else {
+	    if (stat(real_filename, buf) != 0)
+	    *r = file_raise_errno(filename);
+	    else {
+	    statok = 1;
+	    }
+	}
+    } else {
+	FILE *f;
+	if ((f = file_handle_file_safe(filespec)) == NULL)
+	    *r = make_raise_pack(E_INVARG, "Invalid FHANDLE", filespec);
+	else {
+	    if (fstat(fileno(f), buf) != 0)
+		*r = file_raise_errno(file_handle_name(filespec));
+	    else {
+		statok = 1;
+	    }
+	}
+    }
+    return statok;
 }
 
-const char *file_type_string(umode_t st_mode) {
-  if(S_ISREG(st_mode))
-	 return "reg";
-  else if (S_ISDIR(st_mode))
-	 return "dir";
-  else if (S_ISFIFO(st_mode))
-	 return "fifo";
-  else if (S_ISBLK(st_mode))
-	 return "block";
-  else if (S_ISSOCK(st_mode))
-	 return "socket";
-  else
-	 return "unknown";
+const char *
+file_type_string(umode_t st_mode)
+{
+    if (S_ISREG(st_mode))
+	return "reg";
+    else if (S_ISDIR(st_mode))
+	return "dir";
+    else if (S_ISFIFO(st_mode))
+	return "fifo";
+    else if (S_ISBLK(st_mode))
+	return "block";
+    else if (S_ISSOCK(st_mode))
+	return "socket";
+    else
+	return "unknown";
 }
 
-const char *file_mode_string(umode_t st_mode) {
-  static Stream *s = 0;
-  if(!s)
-	 s = new_stream(4);
-  stream_printf(s, "%03o", st_mode & 0777);
-  return reset_stream(s);
+const char *
+file_mode_string(umode_t st_mode)
+{
+    static Stream *s = 0;
+    if (!s)
+	s = new_stream(4);
+    stream_printf(s, "%03o", st_mode & 0777);
+    return reset_stream(s);
 }
- 
+
 /*
  * INT file_size(STR filename)
  * INT file_size(FHANDLE fh)
@@ -1097,19 +1152,19 @@ const char *file_mode_string(umode_t st_mode) {
 
 static package
 bf_file_size(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  Var     rv;
-  Var filespec = arglist.v.list[1];
-  struct stat buf;
-
-  if (file_stat(progr, filespec, &r, &buf)) {
-	 rv.type = TYPE_INT;
-	 rv.v.num = buf.st_size;
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+{
+    package r;
+    Var     rv;
+    Var filespec = arglist.v.list[1];
+    struct stat buf;
+
+    if (file_stat(progr, filespec, &r, &buf)) {
+	rv.type = TYPE_INT;
+	rv.v.num = buf.st_size;
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -1119,19 +1174,19 @@ bf_file_size(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_mode(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  Var     rv;
-  Var filespec = arglist.v.list[1];
-  struct stat buf;
-
-  if (file_stat(progr, filespec, &r, &buf)) {
-	 rv.type = TYPE_STR;
-	 rv.v.str = str_dup(file_mode_string(buf.st_mode));
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+{
+    package r;
+    Var     rv;
+    Var filespec = arglist.v.list[1];
+    struct stat buf;
+
+    if (file_stat(progr, filespec, &r, &buf)) {
+	rv.type = TYPE_STR;
+	rv.v.str = str_dup(file_mode_string(buf.st_mode));
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -1141,19 +1196,19 @@ bf_file_mode(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_type(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  Var     rv;
-  Var filespec = arglist.v.list[1];
-  struct stat buf;
-
-  if (file_stat(progr, filespec, &r, &buf)) {
-	 rv.type = TYPE_STR;
-	 rv.v.str = str_dup(file_type_string(buf.st_mode));
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+{
+    package r;
+    Var     rv;
+    Var filespec = arglist.v.list[1];
+    struct stat buf;
+
+    if (file_stat(progr, filespec, &r, &buf)) {
+	rv.type = TYPE_STR;
+	rv.v.str = str_dup(file_type_string(buf.st_mode));
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -1163,19 +1218,19 @@ bf_file_type(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_last_access(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  Var     rv;
-  Var filespec = arglist.v.list[1];
-  struct stat buf;
-
-  if (file_stat(progr, filespec, &r, &buf)) {
-	 rv.type = TYPE_INT;
-	 rv.v.num = buf.st_atime;
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+{
+    package r;
+    Var     rv;
+    Var filespec = arglist.v.list[1];
+    struct stat buf;
+
+    if (file_stat(progr, filespec, &r, &buf)) {
+	rv.type = TYPE_INT;
+	rv.v.num = buf.st_atime;
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -1185,19 +1240,19 @@ bf_file_last_access(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_last_modify(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  Var     rv;
-  Var filespec = arglist.v.list[1];
-  struct stat buf;
-
-  if (file_stat(progr, filespec, &r, &buf)) {
-	 rv.type = TYPE_INT;
-	 rv.v.num = buf.st_mtime;
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+{
+    package r;
+    Var     rv;
+    Var filespec = arglist.v.list[1];
+    struct stat buf;
+
+    if (file_stat(progr, filespec, &r, &buf)) {
+	rv.type = TYPE_INT;
+	rv.v.num = buf.st_mtime;
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -1207,19 +1262,19 @@ bf_file_last_modify(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_last_change(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  Var     rv;
-  Var filespec = arglist.v.list[1];
-  struct stat buf;
-
-  if (file_stat(progr, filespec, &r, &buf)) {
-	 rv.type = TYPE_INT;
-	 rv.v.num = buf.st_ctime;
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+{
+    package r;
+    Var     rv;
+    Var filespec = arglist.v.list[1];
+    struct stat buf;
+
+    if (file_stat(progr, filespec, &r, &buf)) {
+	rv.type = TYPE_INT;
+	rv.v.num = buf.st_ctime;
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*
@@ -1229,34 +1284,34 @@ bf_file_last_change(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_stat(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  Var     rv;
-  Var filespec = arglist.v.list[1];
-  struct stat buf;
-
-  if (file_stat(progr, filespec, &r, &buf)) {
-	 rv = new_list(8);
-	 rv.v.list[1].type = TYPE_INT;
-	 rv.v.list[1].v.num = buf.st_size;
-	 rv.v.list[2].type = TYPE_STR;
-	 rv.v.list[2].v.str = str_dup(file_type_string(buf.st_mode));
-	 rv.v.list[3].type = TYPE_STR;
-	 rv.v.list[3].v.str = str_dup(file_mode_string(buf.st_mode));
-	 rv.v.list[4].type = TYPE_STR;
-	 rv.v.list[4].v.str = str_dup("");
-	 rv.v.list[5].type = TYPE_STR;
-	 rv.v.list[5].v.str = str_dup("");
-	 rv.v.list[6].type = TYPE_INT;
-	 rv.v.list[6].v.num = buf.st_atime;
-	 rv.v.list[7].type = TYPE_INT;
-	 rv.v.list[7].v.num = buf.st_mtime;
-	 rv.v.list[8].type = TYPE_INT;
-	 rv.v.list[8].v.num = buf.st_ctime;
-	 r = make_var_pack(rv);
-  }
-  free_var(arglist);
-  return r;
+{
+    package r;
+    Var     rv;
+    Var filespec = arglist.v.list[1];
+    struct stat buf;
+
+    if (file_stat(progr, filespec, &r, &buf)) {
+	rv = new_list(8);
+	rv.v.list[1].type = TYPE_INT;
+	rv.v.list[1].v.num = buf.st_size;
+	rv.v.list[2].type = TYPE_STR;
+	rv.v.list[2].v.str = str_dup(file_type_string(buf.st_mode));
+	rv.v.list[3].type = TYPE_STR;
+	rv.v.list[3].v.str = str_dup(file_mode_string(buf.st_mode));
+	rv.v.list[4].type = TYPE_STR;
+	rv.v.list[4].v.str = str_dup("");
+	rv.v.list[5].type = TYPE_STR;
+	rv.v.list[5].v.str = str_dup("");
+	rv.v.list[6].type = TYPE_INT;
+	rv.v.list[6].v.num = buf.st_atime;
+	rv.v.list[7].type = TYPE_INT;
+	rv.v.list[7].v.num = buf.st_mtime;
+	rv.v.list[8].type = TYPE_INT;
+	rv.v.list[8].v.num = buf.st_ctime;
+	r = make_var_pack(rv);
+    }
+    free_var(arglist);
+    return r;
 }
 
 /*****************************************************************
@@ -1267,81 +1322,84 @@ bf_file_stat(Var arglist, Byte next, void *vdata, Objid progr)
  * LIST file_list(STR pathname, [ANY detailed])
  */
 
-int file_list_select(const struct dirent *d) {
-  const char *name = d->d_name;
-  int l = strlen(name);
-  if((l == 1) && (name[0] == '.'))
-	 return 0;
-  else if ((l == 2) && (name[0] == '.') && (name[1] == '.'))
-	 return 0;
-  else
-	 return 1;
+int
+file_list_select(const struct dirent *d)
+{
+    const char *name = d->d_name;
+    int l = strlen(name);
+    if ((l == 1) && (name[0] == '.'))
+	return 0;
+    else if ((l == 2) && (name[0] == '.') && (name[1] == '.'))
+	return 0;
+    else
+	return 1;
 }
 
 static package
 bf_file_list(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  /* modified to use opendir/readdir which is slightly more "standard"
-     than the original scandir method.   -- AAB 06/03/97
-   */
-  package r;
-  const char *pathspec = arglist.v.list[1].v.str;
-  const char *real_pathname;
-  int	detailed = (arglist.v.list[0].v.num > 1
-						? is_true(arglist.v.list[2])
-						: 0);
-  
-    if(!file_verify_caller(progr)) {
-        r = file_raise_notokcall("file_list", progr);
-    } else if((real_pathname = file_resolve_path(pathspec)) == NULL) {
-        r =  file_raise_notokfilename("file_list", pathspec);
+{
+    /* modified to use opendir/readdir which is slightly more "standard"
+     * than the original scandir method.   -- AAB 06/03/97
+     */
+    package r;
+    const char *pathspec = arglist.v.list[1].v.str;
+    const char *real_pathname;
+    int	detailed = (arglist.v.list[0].v.num > 1
+		    ? is_true(arglist.v.list[2])
+		    : 0);
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_list", progr);
+    } else if ((real_pathname = file_resolve_path(pathspec)) == NULL) {
+	r =  file_raise_notokfilename("file_list", pathspec);
     } else {
-        DIR *curdir;
-        Stream *s = new_stream(64);
-        int failed = 0;
-        struct stat buf;
-        Var     rv, detail;
+	DIR *curdir;
+	Stream *s = new_stream(64);
+	int failed = 0;
+	struct stat buf;
+	Var     rv, detail;
 	struct dirent *curfile;
 
-	if (!(curdir = opendir (real_pathname)))
-		r = file_raise_errno(pathspec);
+	if (!(curdir = opendir(real_pathname)))
+	    r = file_raise_errno(pathspec);
 	else {
-		rv = new_list(0);
-		while ( (curfile = readdir(curdir)) != 0 ) {
-		    if (strncmp(curfile->d_name, ".", 2) != 0 && strncmp(curfile->d_name, "..", 3) != 0) {
-			if (detailed) {
-				stream_add_string(s, real_pathname);
-				stream_add_char(s, '/');
-				stream_add_string(s, curfile->d_name);
-				if (stat(reset_stream(s), &buf) != 0) {
-					failed = 1;
-					break;
-				} else {
-					detail = new_list(4);
-					detail.v.list[1].type = TYPE_STR;
-					detail.v.list[1].v.str = str_dup(curfile->d_name);
-					detail.v.list[2].type = TYPE_STR;
-					detail.v.list[2].v.str = str_dup(file_type_string(buf.st_mode));
-					detail.v.list[3].type = TYPE_STR;
-					detail.v.list[3].v.str = str_dup(file_mode_string(buf.st_mode));
-					detail.v.list[4].type = TYPE_INT;
-					detail.v.list[4].v.num = buf.st_size;
-				}
+	    rv = new_list(0);
+	    while ( (curfile = readdir(curdir)) != 0 ) {
+		if (strncmp(curfile->d_name, ".", 2) != 0 &&
+		    strncmp(curfile->d_name, "..", 3) != 0) {
+		    if (detailed) {
+			stream_add_string(s, real_pathname);
+			stream_add_char(s, '/');
+			stream_add_string(s, curfile->d_name);
+			if (stat(reset_stream(s), &buf) != 0) {
+			    failed = 1;
+			    break;
 			} else {
-				detail.type = TYPE_STR;
-				detail.v.str = str_dup(curfile->d_name);
+			    detail = new_list(4);
+			    detail.v.list[1].type = TYPE_STR;
+			    detail.v.list[1].v.str = str_dup(curfile->d_name);
+			    detail.v.list[2].type = TYPE_STR;
+			    detail.v.list[2].v.str = str_dup(file_type_string(buf.st_mode));
+			    detail.v.list[3].type = TYPE_STR;
+			    detail.v.list[3].v.str = str_dup(file_mode_string(buf.st_mode));
+			    detail.v.list[4].type = TYPE_INT;
+			    detail.v.list[4].v.num = buf.st_size;
 			}
-			rv = listappend(rv, detail);
+		    } else {
+			detail.type = TYPE_STR;
+			detail.v.str = str_dup(curfile->d_name);
 		    }
+		    rv = listappend(rv, detail);
 		}
-		if(failed) {
-			free_var(rv);
-			r = file_raise_errno(pathspec);
-		} else
-			r = make_var_pack(rv);
-		closedir(curdir);
+	    }
+	    if (failed) {
+		free_var(rv);
+		r = file_raise_errno(pathspec);
+	    } else
+		r = make_var_pack(rv);
+	    closedir(curdir);
 	}
-  	free_stream(s);
+	free_stream(s);
     }
     free_var(arglist);
     return r;
@@ -1354,25 +1412,24 @@ bf_file_list(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_mkdir(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  const char *pathspec = arglist.v.list[1].v.str;
-  const char *real_pathname;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_mkdir", progr);
-  } else if((real_pathname = file_resolve_path(pathspec)) == NULL) {
-	 r =  file_raise_notokfilename("file_mkdir", pathspec);
-  } else {
-	 if(mkdir(real_pathname, 0777) != 0) 
-		r = file_raise_errno(pathspec);
-	 else 
-		r = no_var_pack();
-	 
-  }
-  free_var(arglist);
-  return r;
-}			 
+{
+    package r;
+    const char *pathspec = arglist.v.list[1].v.str;
+    const char *real_pathname;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_mkdir", progr);
+    } else if ((real_pathname = file_resolve_path(pathspec)) == NULL) {
+	r =  file_raise_notokfilename("file_mkdir", pathspec);
+    } else {
+	if (mkdir(real_pathname, 0777) != 0)
+	    r = file_raise_errno(pathspec);
+	else
+	    r = no_var_pack();
+    }
+    free_var(arglist);
+    return r;
+}
 
 /*
  * void file_rmdir(STR pathname)
@@ -1380,25 +1437,24 @@ bf_file_mkdir(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_rmdir(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  const char *pathspec = arglist.v.list[1].v.str;
-  const char *real_pathname;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_rmdir", progr);
-  } else if((real_pathname = file_resolve_path(pathspec)) == NULL) {
-	 r =  file_raise_notokfilename("file_rmdir", pathspec);
-  } else {
-	 if(rmdir(real_pathname) != 0)
-		r = file_raise_errno(pathspec);
-	 else 
-		r = no_var_pack();
-	 
-  }
-  free_var(arglist);
-  return r;
-}			 
+{
+    package r;
+    const char *pathspec = arglist.v.list[1].v.str;
+    const char *real_pathname;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_rmdir", progr);
+    } else if ((real_pathname = file_resolve_path(pathspec)) == NULL) {
+	r =  file_raise_notokfilename("file_rmdir", pathspec);
+    } else {
+	if (rmdir(real_pathname) != 0)
+	    r = file_raise_errno(pathspec);
+	else
+	    r = no_var_pack();
+    }
+    free_var(arglist);
+    return r;
+}
 
 /*
  * void file_remove(STR pathname)
@@ -1406,24 +1462,24 @@ bf_file_rmdir(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_remove(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  const char *pathspec = arglist.v.list[1].v.str;
-  const char *real_pathname;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_remove", progr);
-  } else if((real_pathname = file_resolve_path(pathspec)) == NULL) {
-	 r =  file_raise_notokfilename("file_remove", pathspec);
-  } else {
-	 if(remove(real_pathname) != 0)
-		r = file_raise_errno(pathspec);
-	 else 
-		r = no_var_pack();	 
-  }
-  free_var(arglist);
-  return r;
-}			 
+{
+    package r;
+    const char *pathspec = arglist.v.list[1].v.str;
+    const char *real_pathname;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_remove", progr);
+    } else if ((real_pathname = file_resolve_path(pathspec)) == NULL) {
+	r = file_raise_notokfilename("file_remove", pathspec);
+    } else {
+	if (remove(real_pathname) != 0)
+	    r = file_raise_errno(pathspec);
+	else
+	    r = no_var_pack();
+    }
+    free_var(arglist);
+    return r;
+}
 
 /*
  * void file_rename(STR pathname)
@@ -1431,30 +1487,30 @@ bf_file_remove(Var arglist, Byte next, void *vdata, Objid progr)
 
 static package
 bf_file_rename(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  const char *fromspec = arglist.v.list[1].v.str;
-  const char *tospec = arglist.v.list[2].v.str;
-  char *real_fromspec = NULL;
-  const char *real_tospec;
-  
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_rename", progr);
-  } else if((real_fromspec = str_dup(file_resolve_path(fromspec))) == NULL) {
-	 r =  file_raise_notokfilename("file_rename", fromspec);
-  } else if((real_tospec = file_resolve_path(tospec)) == NULL) {
-	 r =  file_raise_notokfilename("file_rename", tospec);
-  } else {
-	 if(rename(real_fromspec, real_tospec) != 0)
-		r = file_raise_errno("rename");
-	 else 
-		r = no_var_pack();	 
-  }
-  if(real_fromspec)
-	 free_str(real_fromspec);
-  free_var(arglist);
-  return r;
-}			 
+{
+    package r;
+    const char *fromspec = arglist.v.list[1].v.str;
+    const char *tospec = arglist.v.list[2].v.str;
+    char *real_fromspec = NULL;
+    const char *real_tospec;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_rename", progr);
+    } else if ((real_fromspec = str_dup(file_resolve_path(fromspec))) == NULL) {
+	r = file_raise_notokfilename("file_rename", fromspec);
+    } else if ((real_tospec = file_resolve_path(tospec)) == NULL) {
+	r = file_raise_notokfilename("file_rename", tospec);
+    } else {
+	if (rename(real_fromspec, real_tospec) != 0)
+	    r = file_raise_errno("rename");
+	else
+	    r = no_var_pack();
+    }
+    if (real_fromspec)
+	free_str(real_fromspec);
+    free_var(arglist);
+    return r;
+}
 
 
 
@@ -1463,50 +1519,52 @@ bf_file_rename(Var arglist, Byte next, void *vdata, Objid progr)
  */
 
 
-int file_chmodstr_to_mode(const char *modespec, mode_t *newmode) {
-  mode_t m = 0;
-  int i = 0, fct = 1;
-
-  if(strlen(modespec) != 3)
-	 return 0;
-  else {
-	 for(i = 2; i >= 0; i--) {
-		char c = modespec[i];
-		if(!((c  >= '0') && (c <= '7')))
-		  return 0;
-		else {
-		  m += fct * (c - '0');
-		}
-		fct *= 8;
-	 }
-  }
-  *newmode = m;
-  return 1;
+int
+file_chmodstr_to_mode(const char *modespec, mode_t *newmode)
+{
+    mode_t m = 0;
+    int i = 0, fct = 1;
+
+    if (strlen(modespec) != 3)
+	return 0;
+    else {
+	for(i = 2; i >= 0; i--) {
+	    char c = modespec[i];
+	    if (!((c  >= '0') && (c <= '7')))
+		return 0;
+	    else {
+		m += fct * (c - '0');
+	    }
+	    fct *= 8;
+	}
+    }
+    *newmode = m;
+    return 1;
 }
 
 static package
 bf_file_chmod(Var arglist, Byte next, void *vdata, Objid progr)
-{  
-  package r;
-  const char *pathspec = arglist.v.list[1].v.str;
-  const char *modespec = arglist.v.list[2].v.str;
-  mode_t newmode;
-  const char *real_filename;
-
-  if(!file_verify_caller(progr)) {
-	 r = file_raise_notokcall("file_chmod", progr);
-  } else if(!file_chmodstr_to_mode(modespec, &newmode)) {
-	 r = make_raise_pack(E_INVARG, "Invalid mode string", zero);	 
-  } else if((real_filename = file_resolve_path(pathspec)) == NULL) {
-	 r =  file_raise_notokfilename("file_chmod", pathspec);
-  } else {
-	 if(chmod(real_filename, newmode) != 0)
-		r = file_raise_errno("chmod");
-	 else 
-		r = no_var_pack();	 
-  }
-  free_var(arglist);
-  return r;
+{
+    package r;
+    const char *pathspec = arglist.v.list[1].v.str;
+    const char *modespec = arglist.v.list[2].v.str;
+    mode_t newmode;
+    const char *real_filename;
+
+    if (!file_verify_caller(progr)) {
+	r = file_raise_notokcall("file_chmod", progr);
+    } else if (!file_chmodstr_to_mode(modespec, &newmode)) {
+	r = make_raise_pack(E_INVARG, "Invalid mode string", zero);
+    } else if ((real_filename = file_resolve_path(pathspec)) == NULL) {
+	r =  file_raise_notokfilename("file_chmod", pathspec);
+    } else {
+	if (chmod(real_filename, newmode) != 0)
+	    r = file_raise_errno("chmod");
+	else
+	    r = no_var_pack();
+    }
+    free_var(arglist);
+    return r;
 }
 
 /************************************************************************/
@@ -1516,42 +1574,42 @@ register_fileio(void)
 {
 #if FILE_IO
 
-  register_function("file_version", 0, 0, bf_file_version);
+    register_function("file_version", 0, 0, bf_file_version);
 
-  register_function("file_open", 2, 2, bf_file_open, TYPE_STR, TYPE_STR);
-  register_function("file_close", 1, 1, bf_file_close, TYPE_INT);
-  register_function("file_name", 1, 1, bf_file_name, TYPE_INT);
-  register_function("file_openmode", 1, 1, bf_file_openmode, TYPE_INT);
+    register_function("file_open", 2, 2, bf_file_open, TYPE_STR, TYPE_STR);
+    register_function("file_close", 1, 1, bf_file_close, TYPE_INT);
+    register_function("file_name", 1, 1, bf_file_name, TYPE_INT);
+    register_function("file_openmode", 1, 1, bf_file_openmode, TYPE_INT);
 
 
-  register_function("file_readline", 1, 1, bf_file_readline, TYPE_INT);
-  register_function("file_readlines", 3, 3, bf_file_readlines, TYPE_INT, TYPE_INT, TYPE_INT);
-  register_function("file_writeline", 2, 2, bf_file_writeline, TYPE_INT, TYPE_STR);
+    register_function("file_readline", 1, 1, bf_file_readline, TYPE_INT);
+    register_function("file_readlines", 3, 3, bf_file_readlines, TYPE_INT, TYPE_INT, TYPE_INT);
+    register_function("file_writeline", 2, 2, bf_file_writeline, TYPE_INT, TYPE_STR);
 
-  register_function("file_read", 2, 2, bf_file_read, TYPE_INT, TYPE_INT);
-  register_function("file_write", 2, 2, bf_file_write, TYPE_INT, TYPE_STR);
-  register_function("file_flush", 1, 1, bf_file_flush, TYPE_INT);
+    register_function("file_read", 2, 2, bf_file_read, TYPE_INT, TYPE_INT);
+    register_function("file_write", 2, 2, bf_file_write, TYPE_INT, TYPE_STR);
+    register_function("file_flush", 1, 1, bf_file_flush, TYPE_INT);
 
 
-  register_function("file_seek", 3, 3, bf_file_seek, TYPE_INT, TYPE_INT, TYPE_STR);
-  register_function("file_tell", 1, 1, bf_file_tell, TYPE_INT);
+    register_function("file_seek", 3, 3, bf_file_seek, TYPE_INT, TYPE_INT, TYPE_STR);
+    register_function("file_tell", 1, 1, bf_file_tell, TYPE_INT);
 
-  register_function("file_eof", 1, 1, bf_file_eof, TYPE_INT);
+    register_function("file_eof", 1, 1, bf_file_eof, TYPE_INT);
 
-  register_function("file_list", 1, 2, bf_file_list, TYPE_STR, TYPE_ANY);
-  register_function("file_mkdir", 1, 1, bf_file_mkdir, TYPE_STR);
-  register_function("file_rmdir", 1, 1, bf_file_rmdir, TYPE_STR);
-  register_function("file_remove", 1, 1, bf_file_remove, TYPE_STR);
-  register_function("file_rename", 2, 2, bf_file_rename, TYPE_STR, TYPE_STR);
-  register_function("file_chmod", 2, 2, bf_file_chmod, TYPE_STR, TYPE_STR);
+    register_function("file_list", 1, 2, bf_file_list, TYPE_STR, TYPE_ANY);
+    register_function("file_mkdir", 1, 1, bf_file_mkdir, TYPE_STR);
+    register_function("file_rmdir", 1, 1, bf_file_rmdir, TYPE_STR);
+    register_function("file_remove", 1, 1, bf_file_remove, TYPE_STR);
+    register_function("file_rename", 2, 2, bf_file_rename, TYPE_STR, TYPE_STR);
+    register_function("file_chmod", 2, 2, bf_file_chmod, TYPE_STR, TYPE_STR);
 
-  register_function("file_size", 1, 1, bf_file_size, TYPE_ANY);
-  register_function("file_mode", 1, 1, bf_file_mode, TYPE_ANY);
-  register_function("file_type", 1, 1, bf_file_type, TYPE_ANY);
-  register_function("file_last_access", 1, 1, bf_file_last_access, TYPE_ANY);
-  register_function("file_last_modify", 1, 1, bf_file_last_modify, TYPE_ANY);
-  register_function("file_last_change", 1, 1, bf_file_last_change, TYPE_ANY);
-  register_function("file_stat", 1, 1, bf_file_stat, TYPE_ANY);
+    register_function("file_size", 1, 1, bf_file_size, TYPE_ANY);
+    register_function("file_mode", 1, 1, bf_file_mode, TYPE_ANY);
+    register_function("file_type", 1, 1, bf_file_type, TYPE_ANY);
+    register_function("file_last_access", 1, 1, bf_file_last_access, TYPE_ANY);
+    register_function("file_last_modify", 1, 1, bf_file_last_modify, TYPE_ANY);
+    register_function("file_last_change", 1, 1, bf_file_last_change, TYPE_ANY);
+    register_function("file_stat", 1, 1, bf_file_stat, TYPE_ANY);
 
 #endif
 }
diff --git a/extension-fileio.h b/extension-fileio.h
index 466c698..11cf885 100644
--- a/extension-fileio.h
+++ b/extension-fileio.h
@@ -1,5 +1,5 @@
 /*
- * extension-fileio.h 
+ * extension-fileio.h
  *
  */
 
diff --git a/functions.c b/functions.c
index f886ac6..d8b0b5e 100644
--- a/functions.c
+++ b/functions.c
@@ -56,7 +56,7 @@ static registry bi_function_registries[] =
     register_tasks,
     register_verbs,
 /***************************/
-	 register_fileio
+    register_fileio
 /***************************/
 };
 
diff --git a/keywords.c b/keywords.c
index fb7db83..733bd3e 100644
--- a/keywords.c
+++ b/keywords.c
@@ -1,5 +1,5 @@
 /* C code produced by gperf version 2.1p1 (K&R C version, modified by Pavel) */
-/* Command-line: pgperf/pgperf -aCIptT -k1,3,$ keywords.gperf  */
+/* Command-line: pgperf -aCIptT -k1,3,$ keywords.gperf  */
 
 #include "my-ctype.h"
 
@@ -36,132 +36,178 @@
 #define MAX_HASH_VALUE 106
 /*
    36 keywords
-  104 is the maximum key range
-*/
+   104 is the maximum key range
+ */
 
 static int
-hash (register const char *str, register int len)
+hash(register const char *str, register int len)
 {
-  static const unsigned char hash_table[] =
+    static const unsigned char hash_table[] =
     {
-     106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-     106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-     106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-     106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-     106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-     106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-     106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-     106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-     106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
-     106, 106, 106, 106, 106, 106, 106,  10,   0,  45,
-      20,   0,   0,  10, 106,  45, 106,  10, 106,  35,
-       5, 106,   5,  10,   0,  25,  55, 106,  35,   5,
-     106,  10, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
+	106, 106, 106, 106, 106, 106, 106, 10, 0, 45,
+	20, 0, 0, 10, 106, 45, 106, 10, 106, 35,
+	5, 106, 5, 10, 0, 25, 55, 106, 35, 5,
+	106, 10, 106, 106, 106, 106, 106, 106,
     };
-  register int hval = len;
-
-  switch (hval)
-    {
-      default:
-      case 3:
-        hval += hash_table[tolower((unsigned char) str[2])];
-      case 2:
-      case 1:
-        hval += hash_table[tolower((unsigned char) str[0])];
+    register int hval = len;
+
+    switch (hval) {
+    default:
+    case 3:
+	hval += hash_table[tolower((unsigned char) str[2])];
+    case 2:
+    case 1:
+	hval += hash_table[tolower((unsigned char) str[0])];
     }
-  return hval + hash_table[tolower((unsigned char) str[len - 1])];
+    return hval + hash_table[tolower((unsigned char) str[len - 1])];
 }
 
 static int
-case_strcmp (register const char *str, register const char *key)
+case_strcmp(register const char *str, register const char *key)
 {
-  int ans = 0;
+    int ans = 0;
 
-  while (!(ans = tolower(*str) - (int) *key) && *str)
-    str++, key++;
+    while (!(ans = tolower(*str) - (int) *key) && *str)
+	str++, key++;
 
-  return ans;
+    return ans;
 }
 
 const struct keyword *
-in_word_set (register const char *str, register int len)
+in_word_set(register const char *str, register int len)
 {
 
-  static const struct keyword  wordlist[] =
+    static const struct keyword wordlist[] =
     {
-      {"",}, {"",}, {"",}, 
-      {"for", 		DBV_Prehistory, tFOR},
-      {"",}, {"",}, 
-      {"e_file", 		DBV_FileIO,	tERROR,	E_FILE},
-      {"e_range", 	DBV_Prehistory, tERROR,	E_RANGE},
-      {"",}, 
-      {"e_recmove", 	DBV_Prehistory, tERROR,	E_RECMOVE},
-      {"",}, 
-      {"e_none", 		DBV_Prehistory, tERROR,	E_NONE},
-      {"",}, 
-      {"e_propnf", 	DBV_Prehistory, tERROR,	E_PROPNF},
-      {"fork", 		DBV_Prehistory, tFORK},
-      {"break", 		DBV_BreakCont, tBREAK},
-      {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, 
-      {"finally", 	DBV_Exceptions, tFINALLY},
-      {"",}, {"",}, 
-      {"endif", 		DBV_Prehistory, tENDIF},
-      {"endfor", 		DBV_Prehistory, tENDFOR},
-      {"e_quota", 	DBV_Prehistory, tERROR,	E_QUOTA},
-      {"endwhile", 	DBV_Prehistory, tENDWHILE},
-      {"else", 		DBV_Prehistory, tELSE},
-      {"",}, 
-      {"elseif", 		DBV_Prehistory, tELSEIF},
-      {"",}, 
-      {"any", 		DBV_Exceptions, tANY},
-      {"",}, {"",}, 
-      {"endtry", 		DBV_Exceptions, tENDTRY},
-      {"endfork", 	DBV_Prehistory, tENDFORK},
-      {"",}, {"",}, {"",}, 
-      {"e_args", 		DBV_Prehistory, tERROR,	E_ARGS},
-      {"e_varnf", 	DBV_Prehistory, tERROR,	E_VARNF},
-      {"e_verbnf", 	DBV_Prehistory, tERROR,	E_VERBNF},
-      {"",}, {"",}, 
-      {"e_perm", 		DBV_Prehistory, tERROR,	E_PERM},
-      {"if", 		DBV_Prehistory, tIF},
-      {"",}, {"",}, {"",}, {"",}, 
-      {"in", 		DBV_Prehistory, tIN},
-      {"",}, {"",}, 
-      {"while", 		DBV_Prehistory, tWHILE},
-      {"e_nacc", 		DBV_Prehistory, tERROR,	E_NACC},
-      {"",}, 
-      {"continue", 	DBV_BreakCont, tCONTINUE},
-      {"",}, 
-      {"e_div", 		DBV_Prehistory, tERROR,	E_DIV},
-      {"e_type", 		DBV_Prehistory, tERROR,	E_TYPE},
-      {"e_float", 	DBV_Float,	tERROR,	E_FLOAT},
-      {"e_invarg", 	DBV_Prehistory, tERROR,	E_INVARG},
-      {"",}, {"",}, 
-      {"return", 		DBV_Prehistory, tRETURN},
-      {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, 
-      {"e_invind", 	DBV_Prehistory, tERROR,	E_INVIND},
-      {"",}, {"",}, {"",}, {"",}, 
-      {"try", 		DBV_Exceptions, tTRY},
-      {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, 
-      {"e_maxrec", 	DBV_Prehistory, tERROR,	E_MAXREC},
-      {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, 
-      {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, 
-      {"except", 		DBV_Exceptions, tEXCEPT},
+	{"",},
+	{"",},
+	{"",},
+	{"for", DBV_Prehistory, tFOR},
+	{"",},
+	{"",},
+	{"e_file", DBV_FileIO, tERROR, E_FILE},
+	{"e_range", DBV_Prehistory, tERROR, E_RANGE},
+	{"",},
+	{"e_recmove", DBV_Prehistory, tERROR, E_RECMOVE},
+	{"",},
+	{"e_none", DBV_Prehistory, tERROR, E_NONE},
+	{"",},
+	{"e_propnf", DBV_Prehistory, tERROR, E_PROPNF},
+	{"fork", DBV_Prehistory, tFORK},
+	{"break", DBV_BreakCont, tBREAK},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"finally", DBV_Exceptions, tFINALLY},
+	{"",},
+	{"",},
+	{"endif", DBV_Prehistory, tENDIF},
+	{"endfor", DBV_Prehistory, tENDFOR},
+	{"e_quota", DBV_Prehistory, tERROR, E_QUOTA},
+	{"endwhile", DBV_Prehistory, tENDWHILE},
+	{"else", DBV_Prehistory, tELSE},
+	{"",},
+	{"elseif", DBV_Prehistory, tELSEIF},
+	{"",},
+	{"any", DBV_Exceptions, tANY},
+	{"",},
+	{"",},
+	{"endtry", DBV_Exceptions, tENDTRY},
+	{"endfork", DBV_Prehistory, tENDFORK},
+	{"",},
+	{"",},
+	{"",},
+	{"e_args", DBV_Prehistory, tERROR, E_ARGS},
+	{"e_varnf", DBV_Prehistory, tERROR, E_VARNF},
+	{"e_verbnf", DBV_Prehistory, tERROR, E_VERBNF},
+	{"",},
+	{"",},
+	{"e_perm", DBV_Prehistory, tERROR, E_PERM},
+	{"if", DBV_Prehistory, tIF},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"in", DBV_Prehistory, tIN},
+	{"",},
+	{"",},
+	{"while", DBV_Prehistory, tWHILE},
+	{"e_nacc", DBV_Prehistory, tERROR, E_NACC},
+	{"",},
+	{"continue", DBV_BreakCont, tCONTINUE},
+	{"",},
+	{"e_div", DBV_Prehistory, tERROR, E_DIV},
+	{"e_type", DBV_Prehistory, tERROR, E_TYPE},
+	{"e_float", DBV_Float, tERROR, E_FLOAT},
+	{"e_invarg", DBV_Prehistory, tERROR, E_INVARG},
+	{"",},
+	{"",},
+	{"return", DBV_Prehistory, tRETURN},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"e_invind", DBV_Prehistory, tERROR, E_INVIND},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"try", DBV_Exceptions, tTRY},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"e_maxrec", DBV_Prehistory, tERROR, E_MAXREC},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"",},
+	{"except", DBV_Exceptions, tEXCEPT},
     };
 
-  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
-    {
-      register int key = hash (str, len);
+    if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) {
+	register int key = hash(str, len);
 
-      if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
-        {
-          register const char *s = wordlist[key].name;
+	if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) {
+	    register const char *s = wordlist[key].name;
 
-          if (*s == tolower(*str) && !case_strcmp (str + 1, s + 1))
-            return &wordlist[key];
-        }
+	    if (*s == tolower(*str) && !case_strcmp(str + 1, s + 1))
+		return &wordlist[key];
+	}
     }
-  return 0;
+    return 0;
 }
 
 const struct keyword *
-- 
1.7.3.4

