[liblinear] 21/26: Update patch 0006-Improve-option-parsing

Christian Kastner ckk at moszumanska.debian.org
Sun Sep 6 13:33:13 UTC 2015


This is an automated email from the git hooks/post-receive script.

ckk pushed a commit to branch master
in repository liblinear.

commit 1ce93c7054f11bc8b6ad8fb6da2f228dbc371178
Author: Christian Kastner <ckk at kvr.at>
Date:   Sat Sep 5 23:10:44 2015 +0200

    Update patch 0006-Improve-option-parsing
---
 debian/patches/0006-Improve-option-parsing.patch | 43 +++++++++++++++---------
 1 file changed, 28 insertions(+), 15 deletions(-)

diff --git a/debian/patches/0006-Improve-option-parsing.patch b/debian/patches/0006-Improve-option-parsing.patch
index 58385cd..c0f7738 100644
--- a/debian/patches/0006-Improve-option-parsing.patch
+++ b/debian/patches/0006-Improve-option-parsing.patch
@@ -7,16 +7,16 @@ arguments, and use optarg(3) if possible.
 
 Bug-Debian: http://bugs.debian.org/716115
 Forwarded: yes
-Last-Update: 2014-02-19
+Last-Update: 2015-09-05
 ---
  predict.c | 45 ++++++++++++++++++++++++---------------------
  train.c   | 44 +++++++++++++++++++++++++++++++++++++-------
  2 files changed, 61 insertions(+), 28 deletions(-)
 
-diff --git a/predict.c b/predict.c
-index 0b4be97..831275f 100644
---- a/predict.c
-+++ b/predict.c
+Index: liblinear-2.01+dfsg/predict.c
+===================================================================
+--- liblinear-2.01+dfsg.orig/predict.c
++++ liblinear-2.01+dfsg/predict.c
 @@ -3,6 +3,7 @@
  #include <stdlib.h>
  #include <string.h>
@@ -24,8 +24,8 @@ index 0b4be97..831275f 100644
 +#include <unistd.h>
  #include "linear.h"
  
- struct feature_node *x;
-@@ -164,45 +165,47 @@ void exit_with_help()
+ int print_null(const char *s,...) {return 0;}
+@@ -186,48 +187,50 @@ void exit_with_help()
  int main(int argc, char **argv)
  {
  	FILE *input, *output;
@@ -42,10 +42,13 @@ index 0b4be97..831275f 100644
 -			case 'b':
 -				flag_predict_probability = atoi(argv[i]);
 -				break;
--
+-			case 'q':
+-				info = &print_null;
+-				i--;
+-				break;
 -			default:
 -				fprintf(stderr,"unknown option: -%c\n", argv[i-1][1]);
-+	while ((opt = getopt(argc, argv, "b:")) != -1) {
++	while ((opt = getopt(argc, argv, "b:q")) != -1) {
 +		switch(opt) {
 +		case 'b':
 +			if (strcmp(optarg, "0") == 0) {
@@ -57,6 +60,9 @@ index 0b4be97..831275f 100644
 -				break;
 +			}
 +			break;
++		case 'q':
++			info = &print_null;
++			break;
 +		default:
 +			exit_with_help();
 +			break;
@@ -94,10 +100,10 @@ index 0b4be97..831275f 100644
  		exit(1);
  	}
  
-diff --git a/train.c b/train.c
-index 4920313..fd00525 100644
---- a/train.c
-+++ b/train.c
+Index: liblinear-2.01+dfsg/train.c
+===================================================================
+--- liblinear-2.01+dfsg.orig/train.c
++++ liblinear-2.01+dfsg/train.c
 @@ -4,6 +4,7 @@
  #include <string.h>
  #include <ctype.h>
@@ -106,7 +112,7 @@ index 4920313..fd00525 100644
  #include "linear.h"
  #define Malloc(type,n) (type *)malloc((n)*sizeof(type))
  #define INF HUGE_VAL
-@@ -49,6 +50,34 @@ void exit_input_error(int line_num)
+@@ -61,6 +62,34 @@ void exit_input_error(int line_num)
  	exit(1);
  }
  
@@ -141,17 +147,24 @@ index 4920313..fd00525 100644
  static char *line = NULL;
  static int max_line_len;
  
-@@ -161,32 +190,33 @@ void parse_command_line(int argc, char **argv, char *input_file_name, char *mode
+@@ -224,38 +253,39 @@ void parse_command_line(int argc, char *
  		switch(argv[i-1][1])
  		{
  			case 's':
 -				param.solver_type = atoi(argv[i]);
 +				param.solver_type = strtol_or_exit(argv[i]);
+ 				flag_solver_specified = 1;
  				break;
  
  			case 'c':
 -				param.C = atof(argv[i]);
 +				param.C = strtof_or_exit(argv[i]);
+ 				flag_C_specified = 1;
+ 				break;
+ 
+ 			case 'p':
+-				param.p = atof(argv[i]);
++				param.p = strtof_or_exit(argv[i]);
  				break;
  
  			case 'e':

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/liblinear.git



More information about the debian-science-commits mailing list