[Pkg-octave-commit] r1925 - in octave-forge-pkgs/octave-sockets/trunk/debian: . patches

Thomas Weber thomas-guest at alioth.debian.org
Thu May 15 13:22:11 UTC 2008


Author: thomas-guest
Date: 2008-05-15 13:22:10 +0000 (Thu, 15 May 2008)
New Revision: 1925

Added:
   octave-forge-pkgs/octave-sockets/trunk/debian/patches/
   octave-forge-pkgs/octave-sockets/trunk/debian/patches/gethostname_with_empty_arg
   octave-forge-pkgs/octave-sockets/trunk/debian/patches/series
Modified:
   octave-forge-pkgs/octave-sockets/trunk/debian/changelog
   octave-forge-pkgs/octave-sockets/trunk/debian/control
   octave-forge-pkgs/octave-sockets/trunk/debian/rules
Log:
Don't let gethostbyname crash when called without argument

Modified: octave-forge-pkgs/octave-sockets/trunk/debian/changelog
===================================================================
--- octave-forge-pkgs/octave-sockets/trunk/debian/changelog	2008-05-15 12:52:08 UTC (rev 1924)
+++ octave-forge-pkgs/octave-sockets/trunk/debian/changelog	2008-05-15 13:22:10 UTC (rev 1925)
@@ -1,3 +1,10 @@
+octave-sockets (1.0.4-2) UNRELEASED; urgency=low
+
+  * New patch (gethostname_with_empty_arg) and re-add quilt, patch courtesy of
+    David Bateman.
+
+ -- Thomas Weber <thomas.weber.mail at gmail.com>  Thu, 15 May 2008 15:12:34 +0200
+
 octave-sockets (1.0.4-1) unstable; urgency=low
 
   [ Ólafur Jens Sigurðsson ]

Modified: octave-forge-pkgs/octave-sockets/trunk/debian/control
===================================================================
--- octave-forge-pkgs/octave-sockets/trunk/debian/control	2008-05-15 12:52:08 UTC (rev 1924)
+++ octave-forge-pkgs/octave-sockets/trunk/debian/control	2008-05-15 13:22:10 UTC (rev 1925)
@@ -6,7 +6,7 @@
  Thomas Weber <thomas.weber.mail at gmail.com>,
  Rafael Laboissiere <rafael at debian.org>
 DM-Upload-Allowed: yes
-Build-Depends: debhelper (>= 6), cdbs, octave-pkg-dev (>= 0.5.5)
+Build-Depends: debhelper (>= 6), cdbs, octave-pkg-dev (>= 0.5.5), quilt
 Standards-Version: 3.7.3
 Homepage: http://octave.sourceforge.net/sockets
 Vcs-Svn: svn://svn.debian.org/svn/pkg-octave/octave-forge-pkgs/octave-sockets/trunk

Added: octave-forge-pkgs/octave-sockets/trunk/debian/patches/gethostname_with_empty_arg
===================================================================
--- octave-forge-pkgs/octave-sockets/trunk/debian/patches/gethostname_with_empty_arg	                        (rev 0)
+++ octave-forge-pkgs/octave-sockets/trunk/debian/patches/gethostname_with_empty_arg	2008-05-15 13:22:10 UTC (rev 1925)
@@ -0,0 +1,60 @@
+Don't let gethostbyname crash when called without argument
+http://sourceforge.net/mailarchive/forum.php?thread_name=482C2A85.50707%40motorola.com&forum_name=octave-dev
+--- a/src/sockets.cc
++++ b/src/sockets.cc
+@@ -456,25 +456,31 @@
+ DEFUN_DLD(gethostbyname,args,nargout, \
+ 	  "gethostbyname(string)\nSee the gethostbyname() man pages")
+ {
++  int nargin = args.length ();
+   struct hostent*    hostInfo = NULL;
+-  string_vector host_list;
++  octave_value retval;
+ 
+-
+-  if ( args(0).is_string() )
+-  {
+-    string addr = args(0).string_value();
+-    hostInfo = gethostbyname( addr.c_str() );
+-    if ( hostInfo )
++  if (nargin != 1)
++    print_usage ();
++  else if ( args(0).is_string() )
+     {
+-      for ( int i = 0 ; i < hostInfo->h_length/4 ; i++ )
+-      {
+-	string temp_addr = string(  inet_ntoa( *(struct in_addr*)hostInfo->h_addr_list[i] ));
+-	host_list.append( temp_addr );
+-      }
++      string_vector host_list;
++      string addr = args(0).string_value();
++      hostInfo = gethostbyname( addr.c_str() );
++      if ( hostInfo )
++	{
++	  for ( int i = 0 ; i < hostInfo->h_length/4 ; i++ )
++	    {
++	      string temp_addr = string(  inet_ntoa( *(struct in_addr*)hostInfo->h_addr_list[i] ));
++	      host_list.append( temp_addr );
++	    }
++	}
++      retval = octave_value (host_list);
+     }
+-  }
++  else
++    print_usage ();
+ 
+-  return octave_value(host_list);
++  return retval;
+ }
+ 
+ // PKG_ADD: autoload ("send", "sockets.oct");
+@@ -675,7 +681,8 @@
+   int backlog = args(1).int_value();
+ //  octave_stdout << "BACKLOG: " << backlog << endl;
+ 
+-  retval = ::listen( s->get_sock_fd(), backlog );
++  if (! error_state)
++    retval = ::listen( s->get_sock_fd(), backlog );
+ 
+   return octave_value(retval);
+ }

Added: octave-forge-pkgs/octave-sockets/trunk/debian/patches/series
===================================================================
--- octave-forge-pkgs/octave-sockets/trunk/debian/patches/series	                        (rev 0)
+++ octave-forge-pkgs/octave-sockets/trunk/debian/patches/series	2008-05-15 13:22:10 UTC (rev 1925)
@@ -0,0 +1 @@
+gethostname_with_empty_arg

Modified: octave-forge-pkgs/octave-sockets/trunk/debian/rules
===================================================================
--- octave-forge-pkgs/octave-sockets/trunk/debian/rules	2008-05-15 12:52:08 UTC (rev 1924)
+++ octave-forge-pkgs/octave-sockets/trunk/debian/rules	2008-05-15 13:22:10 UTC (rev 1925)
@@ -2,3 +2,4 @@
 # -*- makefile -*-
 
 include /usr/share/cdbs/1/class/octave-pkg.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk




More information about the Pkg-octave-commit mailing list