File: 43-moreinfo-cnd.c_bug112163

package info (click to toggle)
mgetty 1.2.1-1.2
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 6,416 kB
  • sloc: ansic: 42,743; sh: 6,516; perl: 6,262; makefile: 1,462; tcl: 756; lisp: 283
file content (48 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#! /bin/sh -e
## 
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description. 

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi  
case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
		exit 1;;
esac            

exit 0
@DPATCH@
--- a/cnd.c
+++ b/cnd.c
@@ -171,6 +171,23 @@ cndfind _P1((str), char *str)
 		    if ( *p == '\'' || *p == '\"' || !isprint( (uch)*p ) ) *p = ' ';
 		    p++;
 		}
+
+		if ( strcmp(cp->string,"+CLIP: ") == 0 ) {
+		  char *q ;
+
+		  p = *(cp->variable) ;
+		  q = *(cp->variable) ;
+		  /* strip non digit charaters */
+		  while( ! isdigit(*p) ) p++;
+		  /* shift only digit characters */
+		  while( isdigit(*p) ) {
+		    *q=*p ;
+		    p++ ;
+		    q++ ;
+		  }
+		  *q = 0;
+		}
+
 	    }
 	    lprintf(L_NOISE, "CND: found: %s", *(cp->variable));
 	    return;